﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	resolution	keywords	cc	launchpad_bug
1901	"WUI: the ""Download!"" button on the Welcome page leads to the file displayed in-browser instead of downloaded/saved"	zooko		"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 [changeset:151f69d9b59ee76522c5ae3dad259ded752e8ad4/git long] had a [source:docs/frontends/webapi.rst?rev=05d0b8b5b9247e1d0541e58250a81df89d5c9115#viewing-downloading-a-file 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.

1. 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 [source:docs/frontends/webapi.rst?rev=05d0b8b5b9247e1d0541e58250a81df89d5c9115#viewing-downloading-a-file ""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."	defect	closed	normal	1.10.1	code-frontend-web	1.9.2	fixed	LeastAuthority.com wui easy		
