Quick question I am trying to move an uploaded file to a directory outside of the root to /opt/ffencoderd/data/media and I get file does not exist. If I use exec() in the same file to execute clamscan in /usr/bin/clamscan it works. Anyone know what I am doing wrong?
move_uploaded_file($_FILES['Filedata']['tmp_name'], '/opt/ffencoderd/data/media'.'/'.$id2)
or die ("Couldn't upload ".$_FILES['Filedata']['name']."\n");
Warning:
move_uploaded_file(opt/ffencoderd/data/media/fa3eeb1d502ec3cb7221cac889a8922a)
[function.move-uploaded-file]: failed
to open stream: No such file or
directory in
/opt/lampp/htdocs/xampp/site/progressbar/upload.php
on line 99Warning: move_uploaded_file()
[function.move-uploaded-file]: Unable
to move ‘/tmp/phpRh2VMZ’ to
‘opt/ffencoderd/data/media/fa3eeb1d502ec3cb7221cac889a8922a’
in
/opt/lampp/htdocs/xampp/site/progressbar/upload.php
on line 99
Test that the directory exists and that your PHP script has permissions to write to it with:
If it returns false it may be that the directory doesn’t exist. If you know the directory exists then you will need to modify permissions on the directory. If it has the correct permissions then you’ll need to check your safe_mode and open_basedir settings.