private static boolean writeImages(File file, String unpfilepath) { try { upyunimages.setApiDomain(UpYun.ED_AUTO); upyunimages.setTimeout(60); // 设置待上传文件的 Content-MD5 值 // 如果又拍云服务端收到的文件MD5值与用户设置的不一致,将回报 406 NotAcceptable 错误 upyunimages.setContentMD5(UpYun.md5(file)); return upyunimages.writeFile(unpfilepath, file, true); } catch (Exception e) { ApplicationLogger.error("error", e); return false; } }