Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

attaching files from a web-based form

by Anonymous Monk
on Apr 10, 2003 at 23:38 UTC ( [id://249771]=perlquestion: print w/replies, xml ) Need Help??

Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

What is the easiest way to send virtually any kind of file attachment via a form? Please don't direct me to the super search, I've read all of them and none of them help my problem.

I want to have an upload field in my cgi form then from this have that file attach be sent with the email regardless of the file type. Even if you have to specifiy the file type first I still want to know how to do this via a form, all the examples were paths to files already on the server.

Any help would be much appreciated.

Replies are listed 'Best First'.
Re: attaching files from a web-based form
by dorko (Prior) on Apr 11, 2003 at 00:24 UTC
    Let me start by saying I don't have an answer to your problem.

    From your research, you know how to (A) send an attachment if it's already a file on the server. If you can learn how to (B) use a form to save a file to your server, then you can use (B) + (A) to do what you're looking for.

    (Demonstrate to the Monastery a good faith effort that you have tried and failed to do this on your own, and odds are, you'll get some better help. (i.e. show some code...))

    Cheers,

    Brent
    -- Yeah, I'm a Delt.

    Update: a Super Search on "mail attachment form" lead me to this thread, including the ubiquitous pointer from merlyn to one of his columns.

      After reading up on everything all I could figure out was how to save things to the server and use them then. If that were my goal I wouldn't have had to ask help, I'd rather have a form upload send files on the fly rather than having an external program to upload files and another to send the with. I will take a look at the thread you posted, thanks dorko.
        I don't think it's possible to not save the file at least temporarily before emailing. In any case, you can upload the file, save it, email it, and delete it all in one script. You wouldn't need to have multiple programs.
Re: attaching files from a web-based form
by Jenda (Abbot) on Apr 11, 2003 at 12:28 UTC

    Mail::Sender's docs contain an example.

    Jenda
    Always code as if the guy who ends up maintaining your code will be a violent psychopath who knows where you live.
       -- Rick Osborne

    Edit by castaway: Closed small tag in signature

•Re: attaching files from a web-based form
by merlyn (Sage) on Apr 11, 2003 at 13:08 UTC

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://249771]
Approved by Ovid
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others having an uproarious good time at the Monastery: (6)
As of 2024-03-28 19:54 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found