Controller @PostMapping("/save") public R save(@RequestBody ShareEntity share){ OSSClient oss = new OSSClient(GlobalConfig.domain, GlobalConfig.AccessKeyID,GlobalConfig.AccessKeySecret); InputStream inputStream1; String[] shartimg = new String[2
今天碰到需要把canvas上的的图片转存到阿里云oss,于是百度了半天,一个能打的答案都没有.怒了,自己搞起. 代码超级简单,需要先引入nuget 中啊里云的oss api 1 byte[] arr = Convert.FromBase64String(ImgBase64.Split(',')[1]);//.Split(',')[1] 2 MemoryStream ms = new MemoryStream(arr); 3 // 上传文件. 4 var res = client.PutObjec