Opened at 2013-01-04T23:51:12Z
Last modified at 2014-09-26T22:20:34Z
#1901 closed defect
WUI: the "Download!" button on the Welcome page leads to the file displayed in-browser instead of downloaded/saved — at Version 5
Reported by: | zooko | Owned by: | |
---|---|---|---|
Priority: | normal | Milestone: | 1.10.1 |
Component: | code-frontend-web | Version: | 1.9.2 |
Keywords: | LeastAuthority.com wui easy | Cc: | |
Launchpad Bug: |
Description (last modified by daira)
I just had a call from a customer ("TV") who was surprised that the "Download!" button on the WUI caused the file to display in the web browser (this file was of text/plain type) instead of downloading/saving. I was surprised, too. Investigating, I see that while we've long had a force-download feature, the current WUI doesn't use it!
I reproduced the customer's issue with Firebug turned on and observed the following HTTP transactions.
- When I click "Download!" my browser issues:
GET /uri?uri=$CAP&filename=testdown3.txt
and the tahoe-lafs WUI/WAPI sends a 302 Found status:
HTTP/1.1 302 Found Location: http://127.0.0.1/uri/$CAP?filename=testdown3.txt
and then the browser issues:
GET /uri/$CAP?filename=testdown3.txt
After which the server sends the contents of the text file, along with header Content-Type: text/plain and no Content-Disposition header, and so the browser displays the contents of the file in the browser window.
To close this ticket, make it so that the last request issued by the browser uses the third form for Viewing/Downloading a File, i.e. instead of /uri/$CAP?filename=testdown3.txt, it should request /named/$CAP/filename=testdown3.txt?save=true. I just tested and confirmed that this makes the server include the Content-Disposition header, but /named/$CAP/filename=testdown3.txt?save=true does not.
Change History (5)
comment:1 Changed at 2013-01-04T23:52:54Z by zooko
- Summary changed from WUI: the "Download!" button leads to the file displayed in-browser instead of "downloaded/saved" to WUI: the "Download!" button leads to the file displayed in-browser instead of downloaded/saved
comment:2 follow-up: ↓ 4 Changed at 2013-01-05T00:43:48Z by davidsarah
- Summary changed from WUI: the "Download!" button leads to the file displayed in-browser instead of downloaded/saved to WUI: the "Download!" button on the Welcome page leads to the file displayed in-browser instead of downloaded/saved
comment:3 Changed at 2013-01-05T00:49:57Z by davidsarah
Oh, the Welcome page does already have a View! button. But it doesn't have a filename field in the "View a file or directory" form. I kind-of see how that makes sense, especially for directories, but it results in the browser doing content-sniffing without any information about the type of a file, which I don't like.
comment:4 in reply to: ↑ 2 Changed at 2013-01-05T03:26:00Z by davidsarah
Replying to davidsarah:
I don't think it's correct that the WUI never uses ?save=true. It is used on the Upload results page, as stated in #1551.
Hmm, looking at the source implementing that link (render_download_link in web/unlinked.py), I was mistaken in thinking it uses ?save=true.
comment:5 Changed at 2014-03-05T02:55:08Z by daira
- Description modified (diff)
I don't think it's correct that the WUI never uses ?save=true. It is used on the Upload results page, as stated in #1551.
My preference would be to include both Download and View links/buttons: