XUpload - XUpload Pro with another form

Message
Author
Thomas
Posts: 8
Joined: Sep 13, 2007 6:32 pm

XUpload Pro with another form

#1 Postby Thomas » Sep 13, 2007 6:35 pm

Hi,

XFileUpload Pro seems to be installed and working correctly, so i can select and upload multiple files using the circle process bar.

What i want to happen is for the upload to occur, and the when completed submit a form on the existing page. Right now the upload finishes and clears the existing window and dumps out the results.

I'd like to suppress the results to an iframe, and keep it hidden, and then submit the form that's on the existing page if the upload has succeeded.

Any suggestions on where to look in xFile upload?

Thomas

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

#2 Postby PilgrimX182 » Sep 14, 2007 7:43 am

If you don't need POST redirect you can comment this block of code in upload.cgi:

Code: Select all

### Sending data with POST request if need
my $url_post = $c->{url_post} || $ENV{HTTP_REFERER};
if($url_post)
{
   if($url_post=~/\.htm(l|)$/i)
   {
      print"Content-type: text/html\n\n";
      print"<HTML><HEAD><Script>parent.document.location='$url_post'</Script></HEAD></HTML>";
      exit;
   }
   if($ENV{QUERY_STRING}!~/js_on=1/)
   {
     $url_post.='?';
     $url_post.="\&$_->{name}=$_->{value}" for @har;
     print $cg->redirect( $url_post );
     exit;
   }
   print"Content-type: text/html\n\n";
   print"<HTML><BODY><Form name='F1' action='$url_post' target='_parent' method='POST'>";
   print"<textarea name='$_->{name}'>$_->{value}</textarea>" for @har;
   print"</Form><Script>document.location='javascript:false';document.F1.submit();</Script></BODY></HTML>";
   exit;
}