You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl@perl.apache.org by Lukas Ertl <a9...@unet.univie.ac.at> on 2000/07/20 23:47:22 UTC

File uploads, Apache::Request

I have a mod_perl app where I try to send mail via MIME::Entity, so that I
can add attachments. To handle the file upload, I use Apache::Request, but
I always get this error:

read-open image.jpg: No such file or directory at
/usr/local/lib/perl5/site_perl/5.005/MIME/Body.pm line 407.

The code snippet for adding attachments goes like this:

my $r = shift;
my $apr = Apache::Request->new($r);
# ...
if ($apr->param("file")) {
	my $upload = $apr->upload;
	$mail->attach(Path => $upload->filename,
                     Type => $upload->type,
                     Encoding => '-SUGGEST');
}

($mail is a MIME::Entity ref.)
$upload->filename contains "image.jpg".
Sending mail without attachments works. 

Anyone had this problem before?

-- 
"Shit doesn't happen; shit is."
	-- anonymous


Re: File uploads, Apache::Request

Posted by Lukas Ertl <a9...@unet.univie.ac.at>.
On Thu, 20 Jul 2000, Lukas Ertl wrote:

> I have a mod_perl app where I try to send mail via MIME::Entity, so that I
> can add attachments. To handle the file upload, I use Apache::Request, but
> I always get this error:
> 
> read-open image.jpg: No such file or directory at
> /usr/local/lib/perl5/site_perl/5.005/MIME/Body.pm line 407.

Please ignore my first post, I fixed it: when I use MIME::Lite instead of
MIME::Entity, I can pass a filehandle, which I get via $upload->fh.

Everything's working now.

Sorry for the inconvenience,

lg,
le

-- 
"Shit doesn't happen; shit is."
	-- anonymous