XUpload - Run additional script after a successful upload

Message
Author
atarix13
Posts: 3
Joined: Oct 28, 2009 6:41 am

Run additional script after a successful upload

#1 Postby atarix13 » Oct 28, 2009 6:50 am

Good time of day.
I NOT worked with perl, so the appeal here - help with running php script with the transfer of parameter - the name of the file (already saved).

1) Where to insert a line call in the `system` startup upload.cgi?
2) The line will run both look like:

Code: Select all

system ( "/usr/bin/php -f /home/upload/public_html/compress.php $ filename> / dev / urandom"); 
$ filename - the filename variable, which is accessible by code upload.cgi

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

#2 Postby PilgrimX182 » Oct 28, 2009 8:13 am


atarix13
Posts: 3
Joined: Oct 28, 2009 6:41 am

#3 Postby atarix13 » Oct 28, 2009 8:41 am

PilgrimX182 wrote:Check this out: http://www.webmasterworld.com/forum13/3512.htm
Ok, thanks, php script processing.
Question structure - how to get $filename, which may change.

Code: Select all

$i++ while (-e "$new_puth/$fn$i$ext" && $c->{copy_mode} eq 'Rename');

#Тут вроде как работает, без ренейменных файлов
#system("/home/upload/public_html/compress.php $login $filename");

$filename="$fn$i$ext";
push @file_status, "OK. renamed to:$filename" if $i;
&lmsg("MSG:File '$fn$ext' already exist!<br>New file saved as '$filename'.") if $i;
where truth is here ...

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

#4 Postby PilgrimX182 » Oct 28, 2009 8:52 am

Use the $filename right after line:

Code: Select all

$filename="$fn$i$ext";

atarix13
Posts: 3
Joined: Oct 28, 2009 6:41 am

#5 Postby atarix13 » Oct 29, 2009 8:05 am