http-stream for download

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View

i am creating a small server-script, which has to be able to send a file to
the browser (file-download).

if the browser is asking for the file, i am sending this header:
"HTTP/1.1 200 OK
Date: Wed, 15 Oct 2003 10:44:51 GMT
Content-Type: application/octet-stream
Cache-Control: max-age=0, no-cache, must-revalidate
Expires: Wed, 15 Oct 2003 10:44:51 GMT
pragma: no-cache
Connection: Close
Content-Disposition: attachment;filename=<filename>
Content-Length: <length_of_file>"

after this i am opening the file in binary mode and add each bit to the

the browser recognizes this stream as a download stream and askes me, if i
wanna accept it. after i made my choice, i get an error message, telling me,
that the browser is unable to open the file.

has anyone some idea?

th@nx Flo

Re: http-stream for download

Quoted text here. Click to load it

AFAICT, this seems to be a system error, rather than a server
error. Are you sure you're saving the file to a location where
you have appropriate permissions? Do you have disk space


Re: http-stream for download

Florian Windhaus wrote:

Quoted text here. Click to load it

Are you leaving a blank line before sending the file? If not, do.

Toby A Inkster BSc (Hons) ARCS
Contact Me -

Site Timeline