konkapp
Thu 11 January 2007, 07:11 pm GMT +0200
Nevermind, finally made it to work.
Hi,
I'm trying to make a more generic upload page, based on the example file but...
I want the path to change depending on the querystring of the page.
I tried setting the paths on an array and then setting the upload_dir from it but it didn't work.
$pathh[1] = "../images/products1/";
$pathh[2] = "../images/products2/";
$my_upload = new file_upload;
$my_upload->upload_dir = $pathh[$colname_cc];
I tried using if statements, didn't work either.
Every time time I get the error that the directory does not exist.
When I set the make dir option to true, it seems that its trying to make a dir.. nowhere! Here's the debug:
Warning: mkdir() [function.mkdir]: No such file or directory in /Library/WebServer/Documents/mysite/upload_class/upload_class.php on line 150
Warning: move_uploaded_file(1168535720.jpg) [function.move-uploaded-file]: failed to open stream: Permission denied in /Library/WebServer/Documents/mysite/upload_class/upload_class.php on line 130
Warning: move_uploaded_file() [function.move-uploaded-file]: Unable to move '/var/tmp/phpNiFkAV' to '1168535720.jpg' in /Library/WebServer/Documents/mysite/upload_class/upload_class.php on line 130
Any suggestions? Thanks
Hi,
I'm trying to make a more generic upload page, based on the example file but...
I want the path to change depending on the querystring of the page.
I tried setting the paths on an array and then setting the upload_dir from it but it didn't work.
$pathh[1] = "../images/products1/";
$pathh[2] = "../images/products2/";
$my_upload = new file_upload;
$my_upload->upload_dir = $pathh[$colname_cc];
I tried using if statements, didn't work either.
Every time time I get the error that the directory does not exist.
When I set the make dir option to true, it seems that its trying to make a dir.. nowhere! Here's the debug:
Warning: mkdir() [function.mkdir]: No such file or directory in /Library/WebServer/Documents/mysite/upload_class/upload_class.php on line 150
Warning: move_uploaded_file(1168535720.jpg) [function.move-uploaded-file]: failed to open stream: Permission denied in /Library/WebServer/Documents/mysite/upload_class/upload_class.php on line 130
Warning: move_uploaded_file() [function.move-uploaded-file]: Unable to move '/var/tmp/phpNiFkAV' to '1168535720.jpg' in /Library/WebServer/Documents/mysite/upload_class/upload_class.php on line 130
Any suggestions? Thanks