I am using Windows Small Business Server 2003 with XUpload 3.1. Everything works great with one exception.
If I put a value in the "confirm_email" option, the browser will hang after transferring a file but before sending any emails. The file actually transfers but no emails are sent.
If I leave the option blank, the file transfers correctly and an email is sent to the person uploading the file (as long as they provide the email in the form).
The confirm_email option is important to me and I would like to see if anyone has an idea of what is wrong.
Thank you in advance for your help.
XUpload - confirm_email causes browser to hang
- PilgrimX182
- Posts: 2186
- Joined: Mar 22, 2006 1:39 pm
The sendmail appears to be working because it will send an email to the Uploader. But, it will not send one to the Administrator.
In the file upload.cgi, there is a section called "Send E-mail to Admin". There is also a section called "Send E-mail to Uploader. "Send E-mail to Uploader" works fine but "Send E-mail to Admin" does not.
I have looked over both of these sections to try to determine any differences. What I have found out is that the one that works..."Send E-mail to Uploader" does not use MIME and sends the message throught the subroutine &SendMail.
I noticed that in the code for the "Send E-mail to Admin", the subroutine &sendmail is commented out with the #. Then there is some MIME programming and it appears that the message is supposed to be sent with the command $msg->send:. It is somewhere in this "Send E-mail to Admin" that the program hangs. Since I am not very familiar with how MIME works, I cannot make much of a determination.
Could I uncomment the &SendMail line and delete all the MIME code? What would that do?
In the file upload.cgi, there is a section called "Send E-mail to Admin". There is also a section called "Send E-mail to Uploader. "Send E-mail to Uploader" works fine but "Send E-mail to Admin" does not.
I have looked over both of these sections to try to determine any differences. What I have found out is that the one that works..."Send E-mail to Uploader" does not use MIME and sends the message throught the subroutine &SendMail.
I noticed that in the code for the "Send E-mail to Admin", the subroutine &sendmail is commented out with the #. Then there is some MIME programming and it appears that the message is supposed to be sent with the command $msg->send:. It is somewhere in this "Send E-mail to Admin" that the program hangs. Since I am not very familiar with how MIME works, I cannot make much of a determination.
Could I uncomment the &SendMail line and delete all the MIME code? What would that do?
It now works
I tried deleting the MIME code and I uncommented the &SendMail line in the "Send E-Mail to Administrator" and the program now appears to be working correctly.
Is this possibly what should be done when used in Windows?
Is this possibly what should be done when used in Windows?
- PilgrimX182
- Posts: 2186
- Joined: Mar 22, 2006 1:39 pm
You can comment this part in upload.cgi:
and Uncomment this line:
I guess this will work out.
Code: Select all
require MIME::Lite;
my $msg = MIME::Lite->new (
From => $c->{confirm_email_from},
To => $c->{confirm_email},
Subject => $subject,
Type =>'multipart/mixed'
) or die "Error creating multipart container: $!\n";
$msg->attr("content-type.charset" => "UTF-8");
$msg->attach(Type => 'text/html', Data => $tmpl->output );
for(@files)
{
$msg->attach (
Type => 'application/octet-stream',
Path => "$c->{target_dir}/$_->{file_name}",
Filename => $_->{file_name},
Disposition => 'attachment'
) if $c->{email_file_attach};
}
$msg->send;
Code: Select all
#&SendMail( $c->{confirm_email}, $c->{confirm_email_from}, $subject, $tmpl->output() );