Skip to content
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

Safari adds "txt" file extension to downloaded files #30

Closed
paulgalow opened this issue Jan 21, 2020 · 2 comments
Closed

Safari adds "txt" file extension to downloaded files #30

paulgalow opened this issue Jan 21, 2020 · 2 comments

Comments

@paulgalow
Copy link

Hi @epoupon ,

I have been running into an issue for a while where Safari adds a 'txt' file extension to every downloaded file. I have tested this on macOS 10.13.X and 10.14.6 as well as iOS 13.3. The issue does not come up using Chrome or Firefox. My guess is that Safari's behaviour is due to the HTTP Content-Type response header being set to "text/plain".

How to reproduce
Upload a test file to the demo instance and download it using Safari. Inspect the downloaded file. It has a "txt" extension attached to it.

Possible remediation
The HTTP response header when downloading a file is set to Content-Type: text/plain. Changing it to Content-Type: application/octet-stream might fix this behaviour.

I would like to submit a pull request but could not find the settings in your source code. Sorry.

Thanks for all your work!

@epoupon
Copy link
Owner

epoupon commented Jan 21, 2020

Hi!
Thanks for reporting!
As far as I remember I decided not to put a mime type since I cannot be sure of the underlying file type. However I was not aware that the Wt library would put a "text/plain" mime type by default.

@paulgalow
Copy link
Author

Thanks for fixing this so quickly. In my testing the issue has been fixed. I have just updated the Docker image.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants