• Please be aware: Kaspersky Anti-Virus has been deprecated
    With the upgrade to Plesk Obsidian 18.0.64, "Kaspersky Anti-Virus for Servers" will be automatically removed from the servers it is installed on. We recommend that you migrate to Sophos Anti-Virus for Servers.
  • The Horde webmail has been deprecated. Its complete removal is scheduled for April 2025. For details and recommended actions, see the Feature and Deprecation Plan.
  • We’re working on enhancing the Monitoring feature in Plesk, and we could really use your expertise! If you’re open to sharing your experiences with server and website monitoring or providing feedback, we’d love to have a one-hour online meeting with you.

Issue About Move uploaded file not working online server in php

venitkin

New Pleskian
in the XAMPP localhost i am able to upload images
But windows hositng-plesk online server i am not able upload images/Photos
Error is
Warning
: move_uploaded_file(img/vp12.jpeg): Failed to open stream: Permission denied in G:\PleskVhosts\paidclass.com\sairamweb\My_Profile.php on line 121

Warning: move_uploaded_file(): Unable to move "C:\Windows\Temp\phpD1A.tmp" to "img/vp12.jpeg" in G:\PleskVhosts\paidclass.com\sairamweb\My_Profile.php on line 121
File Not Moved because


Please help me !
 
Possible reasons for move_uploaded_file not working on your online server in PHP could include permissions, file size limitations, or incorrect file paths. Check directory permissions, file size limits, and ensure correct file paths are used.
 
in the XAMPP localhost i am able to upload images
But windows hositng-plesk online server i am not able upload images/Photos
Error is
Warning
: move_uploaded_file(img/vp12.jpeg): Failed to open stream: Permission denied in G:\PleskVhosts\paidclass.com\sairamweb\My_Profile.php on line 121

Warning: move_uploaded_file(): Unable to move "C:\Windows\Temp\phpD1A.tmp" to "img/vp12.jpeg" in G:\PleskVhosts\paidclass.com\sairamweb\My_Profile.php on line 121
File Not Moved because


Please help me !
Hello I have the same issue too! Please try use error handling by adding lines below

if (move_uploaded_file($_FILES["uploaded-img"]["tmp_name"],"files/path/" . $newFilename)) {
echo "File successfully uploaded and moved.";
} else {
echo "Error moving file: " . $_FILES['uploaded-img']['error'];
}

Not sure why must add this to make it works, I hope someone can explain to me too.
 
Back
Top