Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

RE: RE: Re: File Download

by Anonymous Monk
on Apr 27, 2000 at 17:23 UTC ( [id://9390]=note: print w/replies, xml ) Need Help??


in reply to RE: Re: File Download
in thread File Download

The crucial part is the "Content-disposition" parameter.

Incidentally, you should use
Content-disposition: attachment; filename=file

Instead of "inline" if you really want the save-as box to pop up. It probably won't make any difference, but it could if the user has a program set up to handle the content-type you're returning (for example, if you're returning a pdf file).

Incidentally, the RFC on HTTP/1.1 only defines behavior with "attachment". (And that only in an appendix under "Additional Features")

Replies are listed 'Best First'.
RE: RE: RE: Re: File Download
by BBQ (Curate) on Apr 28, 2000 at 08:24 UTC
    I had no idea that inline wasn't in the RFC. To be perfectly honest, I haven't even read it. I got the full header by ripping it off a bare telnet GET request and examining the response. I saw a CGI app that did what I wanted (I *think* its the download app at e.themes.org) and tried to mime what it was doing.

    One of those things that happen outta mere curiosity...
      Oh! And for Win machines with Internet Exploder, it won't even ask you if it knows the file type... Even with the content-type being Octet/Stream it'll open .txt, .htm, .gif on the screen instead of popping-up the 'Save As' dialogue (which was what I wanted it to do in the 1st place, assuming that it IS a download app, and not a browse app.)

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://9390]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others perusing the Monastery: (3)
As of 2024-04-25 17:54 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found