-
Notifications
You must be signed in to change notification settings - Fork 476
New issue
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
S3 redirect for file downloads: UTF8 characters in filenames cause problems #4524
Comments
P.S. I solved it quickly for the user who reported the problem above, by simply replacing the "funky dash" with the regular "-" in the filemetadata. |
This might be a naive question, but why is a UTF-8 encoded document trying to represent something in ISO-88-59-1? |
I don't know the answer tbh just yet. |
…content-disposition header in the pre-signed S3 download url. #4524
I checked in a quick fix that encodes the filename, specifically as a UTF8 string:
It appears to be working, but I only tested with chrome. Stuff like this can behave differently in different browsers, so I'll test a little more. |
I took a look at pull request #4542 and ran the code locally. It seems to work fine and makes sense. Moving to QA. |
A small fix is needed for the new redirect-to-S3 mechanism. Filenames with certain binary UTF8 characters in them are causing problems. (We insert the filename into the pre-signed S3 urls, so that the users can download files under their real names, and not the generated names under which they are stored...) It's just a matter of encoding these characters somehow, or adding the encoding the name UTF8 to the header... Should be a 1 line fix.
Details:
Reported by a user, RT 259323:
Problem downloading a specific file, error message:
the filename above looks "normal" enough, but the dash between 1976 and 2016 is actually the "long dash", which is a UTF8 character, represented by 3 binary bytes: xE2 x80 x93.
Note that this filename works just fine when we put it into the "content-disposition" header in our normal download code. It is something about passing it to S3 - as a URL argument - that causes a problem. So it's just a matter of encoding it somehow.
The text was updated successfully, but these errors were encountered: