I have a script on my server for uploading file. It is working fine before but suddenly it cannot upload files to the server. I did not change the code, I did not change anything related to php setting or directories permission also for the server. I did not change any thing in the webserver (apache). I created a small script to isolate the problem but I did not get any error messages or warning. The script are the following:
<?php
error_reporting(E_ALL);
ini_set('display_errors', '1');
ini_set('error_reporting', E_ALL);
$target_path = "/var/www/vhosts/mydomain.com/httpdocs/userfiles3/2010-01-27/";
$target_path = $target_path . basename( $_FILES['uploadedfile']['name']);
if(move_uploaded_file($_FILES['uploadedfile']['tmp_name'], $target_path)) {
echo "The file ". basename( $_FILES['uploadedfile']['name']).
" has been uploaded";
} else{
echo "There was an error uploading the file, please try again!";
}
?>