[tahoe-lafs-trac-stream] [tahoe-lafs] #1901: WUI: the "Download!" button on the Welcome page leads to the file displayed in-browser instead of downloaded/saved

tahoe-lafs trac at tahoe-lafs.org
Wed Mar 5 02:55:32 UTC 2014


#1901: WUI: the "Download!" button on the Welcome page leads to the file displayed
in-browser instead of downloaded/saved
---------------------------------+-----------------------------------------
     Reporter:  zooko            |      Owner:
         Type:  defect           |     Status:  new
     Priority:  normal           |  Milestone:  undecided
    Component:  code-frontend-   |    Version:  1.9.2
  web                            |   Keywords:  LeastAuthority.com wui easy
   Resolution:                   |
Launchpad Bug:                   |
---------------------------------+-----------------------------------------
Description changed by daira:

Old 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
> [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:git/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.

New 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
 [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.

--

-- 
Ticket URL: <https://tahoe-lafs.org/trac/tahoe-lafs/ticket/1901#comment:6>
tahoe-lafs <https://tahoe-lafs.org>
secure decentralized storage


More information about the tahoe-lafs-trac-stream mailing list