in reply to Download File using CGI

If I get it correctly it looks like you're outputting some text ( print("<BR>DOWNLOAD ATTEMPT 6<BR>") ) BEFORE sending the headers. This can't work, you must send the headers first, before anything else.
Then I think any of the proposed headers should work.

Replies are listed 'Best First'.
Re: Download File using CGI
by MonkPaul (Friar) on Jun 01, 2005 at 14:49 UTC
    Ah, i see

    At the moment i am outputting the contents of the other files to the screen so the user can view them at their discretion, but if a want to be able to download the files then i should, possibly, start a new script that would just print the headers first, thus downloading the files.
    Cheers

    Any ideas on where the files are downloaded to ?

    MonkPaul

      Any ideas on where the files are downloaded to ?

      As mentioned elsewhere in this thread, you can't know where the files are stored after they're downloaded - if they're not just displayed inline anyway.

      You probably shouldn't care about it, since there's nothing you can do about that - the content-dispostion header is just a hint for the browser.