• Introducing WebPros Cloud - a fully managed infrastructure platform purpose-built to simplify the deployment of WebPros products !  WebPros Cloud enables you to easily deliver WebPros solutions — without the complexity of managing the infrastructure.
    Join the pilot program today!
  • Support for BIND DNS has been removed from Plesk for Windows due to security and maintenance risks.
    If a Plesk for Windows server is still using BIND, the upgrade to Plesk Obsidian 18.0.70 will be unavailable until the administrator switches the DNS server to Microsoft DNS.

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