unzip: 'error: cannot create file' after upload
Posted: Sat Jul 08, 2006 2:21 pm
Er.. dunno if this would go in the linux forum or here. In any case...
I get the following output from unzip.info: (8 is $ndir)
Archive: /var/www/localhost/htdocs/photos/8/1234.zip
error: cannot create file1.jpg
error: cannot create ...
Permissions are:
photos: 777
$ndir: 777
uploaded.zip: 666
Code: Select all
$zname = basename($_FILES['file']['name']);
$destf = BASEDIR.'photos/'.$ndir; //BASEDIR = /var/www/localhost/htdocs/
mkdir($destf,0777);
$dest = $destf.'/'.$zname;
if (!move_uploaded_file($_FILES['file']['tmp_name'], $dest)) return 'Error moving uploaded file.';
chmod($dest,0666); //do I need this?
chdir($destf);
shell_exec("unzip $dest &>info/unzip.info");
chdir('../..'.ADMIN_CP); //back to where it wasArchive: /var/www/localhost/htdocs/photos/8/1234.zip
error: cannot create file1.jpg
error: cannot create ...
Permissions are:
photos: 777
$ndir: 777
uploaded.zip: 666