1

I have a custom PHP website hosted on a Plesk(Windows Hosting Server of Godaddy)

When I submit the form, all of the values get updated, but the image does not get updated. This is the error shown on the page

PHP Warning: move_uploaded_file(../../../uploads/channels/3.jpg): failed to open stream: 
Permission denied in G:\PleskVhosts\dramatainment.com\httpdocs\dashboard\admin\actions\update_queries.php on line 50
PHP Warning: move_uploaded_file(): Unable to move 'C:\Windows\Temp\php5E2E.tmp' to '../../../uploads/channels/3.jpg' in G:\PleskVhosts\dramatainment.com\httpdocs\dashboard\admin\actions\update_queries.php on line 50

I am using the code that I got from w3schools.com here is the link to that script http://www.w3schools.com/php/php_file_upload.asp

Any help would be greatly appreciated.

Engr Atiq
  • 163
  • 2
  • 16
  • it seems like you are trying to write to a location, you arent allowed to write to, as the current user. – Syntac Oct 08 '16 at 10:32
  • yes you have to give 755 permision to your file upload folder – Ashok Chandrapal Oct 08 '16 at 10:42
  • How do i do that? Can you please tell me – Engr Atiq Oct 08 '16 at 11:08
  • This is the error I get when I click on the change permissions link Internal error: filemng failed: Unable to get the object (G:\PleskVhosts\dramatainment.com\uploads) security info: (2) The system cannot find the file specified. at execute "C:\Program Files (x86)\Parallels\Plesk\admin\bin\filemng.exe" UmerAtiq --permissions --list-common "--file=G:\PleskVhosts\dramatainment.com\uploads" "--accounts=tmpCF93.tmp"(RunTime::RunAsUser::run line 221) (Error code 1) – Engr Atiq Oct 08 '16 at 11:17
  • Possible duplicate of [PHP - Failed to open stream : No such file or directory](http://stackoverflow.com/questions/36577020/php-failed-to-open-stream-no-such-file-or-directory) – Vic Seedoubleyew Oct 08 '16 at 17:38

1 Answers1

1

Give write permission for destination folder to which you are moving image file.

Sagar
  • 642
  • 3
  • 14
  • if you are using linux based server then this should be like this: sudo chmod 755 directory_name But in my opinion, better consult server admin. – Sagar Oct 08 '16 at 11:15
  • I am using godaddy windows hosting. Now i know how do i change it. But here is the error i get when i click on the link to change permissions – Engr Atiq Oct 08 '16 at 11:16
  • This is the error I get when I click on the change permissions link Internal error: filemng failed: Unable to get the object (G:\PleskVhosts\dramatainment.com\uploads) security info: (2) The system cannot find the file specified. at execute "C:\Program Files (x86)\Parallels\Plesk\admin\bin\filemng.exe" UmerAtiq --permissions --list-common "--file=G:\PleskVhosts\dramatainment.com\uploads" "--accounts=tmpCF93.tmp"(RunTime::RunAsUser::run line 221) (Error code 1) – Engr Atiq Oct 08 '16 at 11:17