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

Hi,

Does anyone have some tips on how to load an attachment from a web form (<input type="file" name="attachment">), save it onto a linux server, and then email it to a user?

I have the email code, I just don't have the code to get the file from the client machine (more often than not windows) to the linux web server.

I have tried all sorts of methods, file::Copy, file::Basename all with no joy.

Am becoming desparate!

  • Comment on Saving and emailing attachments from web forms

Replies are listed 'Best First'.
Re: Saving and emailing attachments from web forms
by gellyfish (Monsignor) on Jun 20, 2003 at 11:57 UTC

    I would look at the documentation for the module CGI as this has an example of file upload which should serve as a good basis for what you want to do.

    /j\
    
Re: Saving and emailing attachments from web forms
by barrd (Canon) on Jun 20, 2003 at 12:12 UTC
    Hi, bodmin,
    As well as looking at the CGI.pm (for the upload) you might also want to have a gander at Mail::Sender, this "I think" if I understand correctly what you are trying to achieve 'should' do the trick.

    HTH (and... it was written by Jenda)