Mug, thanks for writing. According to the documentation on binmode, "Binmode has no effect under Unix." I'll try it anyway and let the list know if it seems to have any effect. Thanks for the reminder about the error condition with unlink.
-Kevin -----Original Message----- From: Mug [mailto:[EMAIL PROTECTED] Sent: Friday, February 23, 2007 8:35 AM To: Zembower, Kevin Cc: beginners@perl.org Subject: Re: File uploading using CGI Zembower, Kevin wrote: > open(TMP_FILE, ">$tmp_file_name") or die "Can't open temp upload file > $tmp_file_name\n"; > Do you want binmode() here? I see you'll use BINARY below. > my $fh = $query->upload('Material_File'); > while (<$fh>) { > print TMP_FILE; > } # while there's more file to upload and store > And if they are binary uploads, do you want to save them in different place ? > close(TMP_FILE); > > $msg->attach(Type =>'BINARY', > Data =>$tmp_file_name, > Filename =>'AttachedFile', > Disposition =>'attachment'); > > #Don't erase; for debugging. > #unlink($tmp_file_name); or die $! # if unlink not success ? > } # If there's a file uploaded > > HTH, Mug -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/