I have a problem uploading files with move_uploaded_file(src, dest).
Uploadify is used to call the upload.php script which is executing:
move_uploaded_file($tempFile, $targetFile);
Every time I upload a file the permission on the ftp server is set to 363.
I tried to set the permission of the file with:
chmod($targetFile, 755);
But this didn’t change anything. What can I do to make this function work correctly?
Also I can’t delete the files from my ftp server, because I get a “permission denied”.
How to delete them?
You need to use an octal value such as
0755.However, use
0644instead since you most likely do not need/want the x-bit set on those files. If you cannot delete them via ftp, try0664or even0666– in shared hosting environments your php scripts usually run as the webserver user and your ftp account uses a different user.