×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Contact US

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Downloading the output of a cgi file

Downloading the output of a cgi file

Downloading the output of a cgi file

(OP)
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

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login


Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close