/**
*
* @Title: decodeBase64ToImage
* @Description: (將base64位的圖片解碼成流 上傳到阿里雲服務器)
* @param base64 圖片的64進制碼
* @param path 圖片的本地生成地址
* @param imgName 圖片名稱
* @param uppath 圖片的oss遠程地址
* @param imgName void (這里描述輸出參數的作用)
* @throws
* @author huyuhang
* @date 2019年3月12日 下午4:53:44
*/
public static void decodeBase64ToImage(String base64,String uppath) {
BASE64Decoder decoder = new BASE64Decoder();
byte[] decoderBytes;
try {
decoderBytes = decoder.decodeBuffer(base64);
ByteArrayInputStream inputStream = new ByteArrayInputStream(decoderBytes);
//上傳到oss
if (uppath.startsWith("/")) {
uppath = uppath.substring(1);
}
//上傳阿里雲
//ossUtil.putObjectMethod(uppath,inputStream);
} catch (IOException e) {
e.printStackTrace();
}
}