Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Re: How do i force the user to download my content?

by Joost (Canon)
on Apr 22, 2002 at 12:43 UTC ( [id://161040]=note: print w/replies, xml ) Need Help??


in reply to How do i force the user to download my content?

As per RFC 2616 (HTTP/1.1), you might try setting the following headers:

Content-Disposition: attachment; filename="fname.ext" Content-Type: application/octet-stream

Note:
In practice the content-disposition only specifies a preferred filename for when you choose "Save as" from your browser-menu.

You also need to set content-type to application/octet-stream if you want the browser to "force" a "Save file as..." popup instead of it trying to display the data first.

Joost.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others admiring the Monastery: (7)
As of 2024-04-19 10:01 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found