XUpload - confirm_email causes browser to hang

Message
Author
dakwest
Posts: 5
Joined: Jun 19, 2009 12:37 pm

confirm_email causes browser to hang

#1 Postby dakwest » Jun 19, 2009 1:04 pm

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.

User avatar
PilgrimX182
Posts: 2186
Joined: Mar 22, 2006 1:39 pm

#2 Postby PilgrimX182 » Jun 26, 2009 7:50 am

Not sure sending emails is possible with xupload on windows actually, at least never try it myself :)

Check sendmail_path value in config. Should point to sendmail.exe if you have it.

dakwest
Posts: 5
Joined: Jun 19, 2009 12:37 pm

#3 Postby dakwest » Jun 26, 2009 3:20 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?

dakwest
Posts: 5
Joined: Jun 19, 2009 12:37 pm

It now works

#4 Postby dakwest » Jun 29, 2009 12:14 pm

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?

User avatar
PilgrimX182
Posts: 2186
Joined: Mar 22, 2006 1:39 pm

#5 Postby PilgrimX182 » Jun 29, 2009 2:10 pm

You can comment this part in upload.cgi:

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;
and Uncomment this line:

Code: Select all

#&SendMail( $c->{confirm_email}, $c->{confirm_email_from}, $subject, $tmpl->output() );
I guess this will work out.

jeffshead
Posts: 18
Joined: Apr 21, 2009 3:26 pm

#6 Postby jeffshead » Sep 29, 2009 6:50 pm

Same issue here.

Commenting and uncommenting the respective lines works but a big reason for me upgrading to 3.1 was for the file attach feature for admin confirmation emails. That functionality is lost since applying the workaround.

PilgrimX182, how can I get the file attach functionality back?