Search This Blog

Google Analytics

Sunday, March 16, 2008

Solving tesUpload Giving chmod Permission Problems

One of the few things that PHP lacks that other web environments have, is the ability to report the progress of a file upload. This means that file uploads, especially uploads of larger files, can be extremely frustrating for end users when they don’t know if the upload is progressing or if it has stalled or if it has even started.

tesUpload solves this problem by using a perl script that handles the progress reporting. Don’t worry if you are a hardcore PHP programmer, you won’t have to touch the perl code at all. Just put the cgi-script in your cgi-bin folder and forget about it.

However, some may encounter permission issues especially when CGI process is running on a different user as compared to the web server's. Hence, uploaded files end up not accessible! A simple workaround is to add a chmod in file upload.cgi. Somewhere near line 224, simply add the below 1 statement and BINGO!
while(<$fh>) {
    print $tmp_fh $_;
}

close($tmp_fh);

chmod 0666, $tmp_filename; /* Added this */

$fsize =(-s $fh);

tesUpload Official Site
http://tomas.epineer.se/tesupload/

Download tesUpload
http://prdownloads.sourceforge.net/tesupload/tesupload-1_1.tar.gz?download

No comments:

Post a Comment

Do provide your constructive comment. I appreciate that.

Popular Posts