guohao-rosicky opened a new pull request, #4920:
URL: https://github.com/apache/ozone/pull/4920

   …
   
   ## What changes were proposed in this pull request?
   
   I generated the download link via s3 presign url and renamed it via 
response-content-disposition, if the target name has something like other 
non-English content, it appears garbled.
   
   Presign url like this:
   ```
   
http://s3endpoint/bucketname/keyname?response-content-disposition=attachment%3B%20filename%20%3D%22%E6%95%B0%E6%8D%AE%E4%BA%91%E7%9B%98%E5%8A%9F%E8%83%BD%E8%A7%A3%E8%AF%BB.pdf%22&X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Date=20230616T093651Z&X-Amz-SignedHeaders=host&X-Amz-Expires=359999&X-Amz-Credential=ASU4JITCHORSVMEOQY9X%2F20230616%2Fozone-test%2Fs3%2Faws4_request&X-Amz-Signature=44962e707bf044e76379f445b03afefa3f31fdf72bd5d0dfd0f1c9cfd8e3ede7
 
   ```
   
   java sdk generates presign url code similar to:
   ```
   GeneratePresignedUrlRequest generatePresignedUrlRequest =
       new GeneratePresignedUrlRequest(bucketName, key);
   
   generatePresignedUrlRequest
       .setExpiration(new Date(System.currentTimeMillis() + 3600 * 100000));
   
   ResponseHeaderOverrides responseHeaderOverrides =
       new ResponseHeaderOverrides();
   responseHeaderOverrides.setContentDisposition("attachment; filename 
=\"测试.pdf\"");
   
   
   generatePresignedUrlRequest.setResponseHeaders(responseHeaderOverrides);
   
   final URL url = s3.generatePresignedUrl(generatePresignedUrlRequest);
   
   System.out.println("get url:" + url); 
   ```
   
   
   ## What is the link to the Apache JIRA
   
   https://issues.apache.org/jira/browse/HDDS-8878
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to