• If you are still using CentOS 7.9, it's time to convert to Alma 8 with the free centos2alma tool by Plesk or Plesk Migrator. Please let us know your experiences or concerns in this thread:
    CentOS2Alma discussion
  • Inviting everyone to the UX test of a new security feature in the WP Toolkit
    For WordPress site owners, threats posed by hackers are ever-present. Because of this, we are developing a new security feature for the WP Toolkit. If the topic of WordPress website security is relevant to you, we would be grateful if you could share your experience and help us test the usability of this feature. We invite you to join us for a 1-hour online session via Google Meet. Select a convenient meeting time with our friendly UX staff here.

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