We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
核心代码如下:
public static String uploadFile(String weixinId, long currentTimeStamp, InputStream inputs) { String ACCESS_KEY = QiniuStaticConfig.getQiniuAccessKey(); String SECRET_KEY = QiniuStaticConfig.getQiniuSecretKey(); String bucketName = QiniuStaticConfig.getQiniuBucketName(); String baseUrl = QiniuStaticConfig.getQiniuShowHost(); // System.out.println(UUID.randomUUID().toString().replaceAll("-","").length()); String qiNiuShowUrl = ""; Mac mac = new Mac(ACCESS_KEY, SECRET_KEY); // 请确保该bucket已经存在 try { String fileKey = weixinId+UUID.randomUUID().toString(); PutPolicy putPolicy = new PutPolicy(bucketName); putPolicy.saveKey = fileKey; String uptoken = putPolicy.token(mac); PutExtra extra = new PutExtra(); InputStream is = inputs; PutRet ret = IoApi.Put(uptoken, fileKey, is, extra); qiNiuShowUrl = String.format("%s%s", baseUrl, fileKey); log.info("\n\t\tret="+JSONObject.toJSONString(ret)); is.close(); if(ret.getException()==null){ return null; } } catch (Exception e) { log.error(e.getMessage()); return null; } return qiNiuShowUrl; }
后台一直输入如下错:
"response":"{\"error\":\"invalid multipart format: unexpected EOF\"}","statusCode":400
The text was updated successfully, but these errors were encountered:
循环调用uploadFile吗?EOF一般是你的输入流有问题
uploadFile
EOF
Sorry, something went wrong.
No branches or pull requests
核心代码如下:
后台一直输入如下错:
The text was updated successfully, but these errors were encountered: