in reply to Cancelling a cgi file transfer
kill 15,$Upload_PID; # Hard-kill and risk half-uploaded temp-files on +disk, if you write them kill 10,$Upload_PID; # Send SIGUSR1 to the upload-script
$SIG{USR1} = sub { unlink $Temp_File; exit; };
If you don't have any sessioning, add a hidden field with some unique token to the upload form. A lovely thing could be:
Your upload script makes itself findable using the token it received from the form (a good idea would be adding the token as GET parameter for early parsing), for example:my $Token = unpack('H*',pack('L',time).pack('S',$$));
or$0 .= '('.$Token.')';
(You should verify the incoming token for matching /^\da-f$/ for security reasons for both solutions! Don't forget to clean up the file after the upload has finished when using a ID-file.)open my $ID_File,'>/dev/shm/tokenfiles/'.$Token; print $ID_File $$; close $ID_File;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Cancelling a cgi file transfer
by Burak (Chaplain) on Aug 24, 2009 at 23:22 UTC | |
|
Re^2: Cancelling a cgi file transfer
by Rogue (Initiate) on Aug 25, 2009 at 12:12 UTC | |
|
Re^2: Cancelling a cgi file transfer
by Anonymous Monk on Sep 02, 2009 at 14:37 UTC | |
by Rogue (Initiate) on Sep 02, 2009 at 15:05 UTC |