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
参考官方上传文件至oss服务器,获取进度数据:https://help.aliyun.com/zh/oss/developer-reference/progress-bar-6?spm=a2c4g.11186623.0.0.33e4466fcHpAuN 在有获取文件授权签名写入的情况下,无法传入监听器对象,造成使用签名的地址上传文件无法获取上传进度的问题。 具体Api如下: ProgressListener progressListener = new PutObjectProgressListenerDemo() OSSClient ossClient = (OSSClient) new OSSClientBuilder().build(endpoint, oSSAccessKeyId, accessKeySecret, signature); PutObjectResult result = ossClient.putObject(url, fin, f.length(), customHeaders, false, progressListener); 在这里并不能传入progressListener对象。 经过,研究可以覆盖实现OSSClient增加 public PutObjectResult putObject(URL signedUrl, InputStream requestContent, long contentLength, Map<String, String> requestHeaders, boolean useChunkEncoding, ProgressListener progressListener) throws OSSException, ClientException { return objectOperation.putObject(signedUrl, requestContent, contentLength, requestHeaders, useChunkEncoding, progressListener); } 同时覆盖实现OSSObjectOperation,增加 public PutObjectResult putObject(URL signedUrl, InputStream requestContent, long contentLength,Map<String, String> requestHeaders, boolean useChunkEncoding,ProgressListener progressListener) throws OSSException, ClientException 方法
并在相关逻辑中传入对象,例如: GenericRequest req = new GenericRequest().withProgressListener(progressListener) RequestMessage request = new RequestMessage(req, null, null); 方能实现
The text was updated successfully, but these errors were encountered:
No branches or pull requests
并在相关逻辑中传入对象,例如:
GenericRequest req = new GenericRequest().withProgressListener(progressListener)
RequestMessage request = new RequestMessage(req, null, null);
方能实现
The text was updated successfully, but these errors were encountered: