TDi
02-21-2010, 09:37 PM
hi there
I am quite new to coding, and have ben struggeling with my upload script for hours now.
I use the move_uploaded_file to move the file from tmp dir to where I want it, but I get this error:
Warning: move_uploaded_file(/home/dir/public_html/info/) [function.move-uploaded-file]: failed to open stream: Is a directory in /home/dir/public_html/dir/admin/testscript.php on line 44
Warning: move_uploaded_file() [function.move-uploaded-file]: Unable to move '/tmp/phpt5HLgF' to '/home/dir/public_html/info/' in /home/dir/public_html/dir/admin/testscript.php on line 44
My code looks like this
$uploadDir = '/home/dir/public_html/info';
$uploadFileName = $_FILES['file']['name'];
$uploadTmpFileName = $_FILES['file']['tmp_name'];
move_uploaded_file($uploadTmpFileName, "$uploadDir/$UploadFileName"); //This is line 44
I am quite new to coding, and have ben struggeling with my upload script for hours now.
I use the move_uploaded_file to move the file from tmp dir to where I want it, but I get this error:
Warning: move_uploaded_file(/home/dir/public_html/info/) [function.move-uploaded-file]: failed to open stream: Is a directory in /home/dir/public_html/dir/admin/testscript.php on line 44
Warning: move_uploaded_file() [function.move-uploaded-file]: Unable to move '/tmp/phpt5HLgF' to '/home/dir/public_html/info/' in /home/dir/public_html/dir/admin/testscript.php on line 44
My code looks like this
$uploadDir = '/home/dir/public_html/info';
$uploadFileName = $_FILES['file']['name'];
$uploadTmpFileName = $_FILES['file']['tmp_name'];
move_uploaded_file($uploadTmpFileName, "$uploadDir/$UploadFileName"); //This is line 44