Describe the bug
When downloading a file from Tencent COS (private write/read bucket) on Safari, the filename is url-encoded like %E4%BE%8B%E5%AD%90.zip, instead of 例子.zip. Firefox on macOS, Firefox on Windows and Chrome on Windows does not have the bug.
To Reproduce
Steps to reproduce the behavior:
Configure the Cloudreve with a Tencent COS (private write/read bucket) storage
Upload a file with Chinese character in its name
Download it on Safari
See error
Expected behavior
The Cloudreve handle the filename correctly
Desktop (please complete the following information):
OS: macOS 13.0.1
Browser: Safari
Version 16.1 (18614.2.9.1.12)
Additional context
Cloudreve passes the response-content-disposition URL param to COS. The param is url-encoded, COS will decode it and response it as Content-Disposition header. However, different browser has different behavior on this header. That is the cause of bug.
On Chrome/Firefox, Cloudreve's behavior is correct. They accepts the Content-Disposition header like Content-Disposition: attachment; filename="%E4%BE%8B%E5%AD%90.zip".
However, on Safari, it works different. It only accepts the header like Content-Disposition: attachment; filename="例子.zip"
I think Cloudreve should determine the browser based on user agent, and pass response-content-disposition for different browsers.
The Internet Explorer's behavior is more weird. I don't want to research on IE for it is too old and even Microsoft is abandoning it.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
Describe the bug When downloading a file from Tencent COS (private write/read bucket) on Safari, the filename is url-encoded like
%E4%BE%8B%E5%AD%90.zip
, instead of例子.zip
. Firefox on macOS, Firefox on Windows and Chrome on Windows does not have the bug.To Reproduce Steps to reproduce the behavior:
Expected behavior The Cloudreve handle the filename correctly
Desktop (please complete the following information):
Additional context Cloudreve passes the
response-content-disposition
URL param to COS. The param is url-encoded, COS will decode it and response it asContent-Disposition
header. However, different browser has different behavior on this header. That is the cause of bug.On Chrome/Firefox, Cloudreve's behavior is correct. They accepts the
Content-Disposition
header likeContent-Disposition: attachment; filename="%E4%BE%8B%E5%AD%90.zip"
.However, on Safari, it works different. It only accepts the header like
Content-Disposition: attachment; filename="例子.zip"
I think Cloudreve should determine the browser based on user agent, and pass
response-content-disposition
for different browsers.The Internet Explorer's behavior is more weird. I don't want to research on IE for it is too old and even Microsoft is abandoning it.