If I understand you right you have a form containing something like:
and want to mail the just uploaded file, right? It's not as simple as you do it. The $q->param('file'); does give you the name of the uploaded file, but if you tried -e $q->param('file'); you'd get false. Cause the file is of course NOT uploaded to the current directory, but to some temp directory. And since MIME::Lite expects a path to the file in it's Path parameter, the mailing fails. You have to use either<input type="file" name="file">
(Not tested! At least I believe you can. I believe CGI.pm uses some magic so you can use the $q->param('file') as a filehandle.) Or... Filename => $file, FH => $q->param('file'), ...
(Again not tested, but this is very similar to what I suggest in Mail::Sender's docs.)# uploading the file... $filename = $query->param('file'); if ($filename ne ""){ $tmp_file = $query->tmpFileName($filename); } ... Filename => $filename, Path => $tmp_file, ...
HTH, Jenda
In reply to Re: email and upload
by Jenda
in thread email and upload
by stu96art
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |