Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Downloading the output of a cgi file

Status
Not open for further replies.

gerald

Programmer
Apr 10, 2000
152
US
Hi there. Was hoping maybe somebody could give me a pointer here.

I am currently working on a web-based email program, and am at the point where I need to deal with attachments. I know how to pick out the attachments from the body of the message, but I would rather not have to output the attachment to another file on the server that can be downloaded by anybody. Rather, I would like to have my Perl script send the attachment directly to the browser and have the browser download it as if it were a file on the server.

For instance, lets say I attach a .zip file to a message and send it to one of my email accounts. Now when I read the message from that email account, it will display a link on the bottom to getattch.cgi and pass the message number and index of the attachment to the script, and rather than sending a new page to the browser, it will send the attachment, and the browser should come up with the dialog box that asks if you want to open the file or save it to disk.

I have tried sending different Content-type: 's first and it just seems to send it to the browser as a text file.

Any ideas would be greatly appreciated.

THanks,
Gerald
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top