0

When I try to upload a file on my system using and moving it using move_upload_file, it shoots the following error:

Warning: move_uploaded_file(/Data/destination_folder/file_name.csv): failed to open stream: Permission denied in /var/www/html/mysite/fileHandler.php on line 110

Warning: move_uploaded_file(): Unable to move '/tmp/phpxqyBmf' to '/Data/destination_folder/file_name.csv' in /var/www/html/mysite/fileHandler.php on line 110

The code works fine on my collegue's system and we have assigned the same ownerships and permissions for the required folders. To try and eliminate it i have even tried this , thisand this. The issue still persists. Following are the permissions for my destination folder:

drwxrwxrwx. 2 apache apache 4096 May 12 15:47 destination_folder

On checking if the file is uploaded using

if (is_uploaded_file($_FILES["efile"]["tmp_name"]))

it returns true.

I have absolutely no idea what else could be the issue. Can anyone spot the mistake i might be doing?

EDIT: If it helps, the uploaded file doesn't appear in the tmp folder!

Community
  • 1
  • 1
abhilashLenka
  • 101
  • 1
  • 12

0 Answers0