Java base 64 图片流转成图片保存到本地可以的,怎么上传到服务器
byte[]b=decoder.decodeBuffer(urlimg);Stringfilename=newDateTime().toString("yyMMddHHm...
byte[] b = decoder.decodeBuffer(urlimg);
String filename= new DateTime().toString("yyMMddHHmmss") + ".jpg";
File imageFile = new File("D://图片//"+filename);
OutputStream out = new FileOutputStream(imageFile);
out.write(b);
out.flush();
out.close(); 展开
String filename= new DateTime().toString("yyMMddHHmmss") + ".jpg";
File imageFile = new File("D://图片//"+filename);
OutputStream out = new FileOutputStream(imageFile);
out.write(b);
out.flush();
out.close(); 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询