Opened at 2013-01-04T23:51:12Z
Last modified at 2014-09-26T22:20:34Z
#1901 closed defect
WUI: the "Download!" button leads to the file displayed in-browser instead of "downloaded/saved" — at Initial Version
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
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.