Re: Script to simulate file downloading
"Patrick Nolan" <pln@glast2.Stanford.EDU> wrote in message
news:slrnfdc6fb.v46.pln@glast2.Stanford.EDU...
> When someone downloads a file, I want the resulting file to have
> the original name, for instance "foobar.doc" instead of "112-1".
> My guess is that it should be possible to accomplish this by
> manipulation of the http headers, but I haven't figured it out yet.
> I have written a perl script that sends headers like this:
> Content-type: application/octet-stream
> Title: foobar.doc
> Content-Length: 26450
>
> and then sends the content of the file. It arrives and is readable,
> but the name of the file produced is the name of the script, not
> foobar.doc.
>
This header should be the one you are after -
Content-Disposition: attachment;filename="foobar.doc"
|