I am php page everything was working fine till today morning. Now the page is not uploading any selected file. All that I keep getting is the following error message:
Warning: move_uploaded_file(upload/BrainStream_2009_06_25_23041.zip) [function.move-uploaded-file]: failed to open stream: No such file or directory in C:\xampp\htdocs\vectorization\admin\jobs_edit.php on line 146
Warning: move_uploaded_file() [function.move-uploaded-file]: Unable to move 'C:\Documents and Settings\Admin\Local Settings\Temp\php1B2.tmp' to 'upload/BrainStream_2009_06_25_23041.zip' in C:\xampp\htdocs\vectorization\admin\jobs_edit.php on line 146 File could not be uploaded. Please select a valid file. File Name:BrainStream.zip
I have written following code:
$uplfile = $_FILES['uploadfile']['name'];
$upltmp = $_FILES["uploadfile"]["tmp_name"];
if(!empty($uplfile))
{
$ext = explode(".", $uplfile);
$upload_date = date("Y_m_d"); //use this variable to change file name to avoid conflict with same name files
$upload_dir = "upload/";
$file_name=$ext[0]."_".$upload_date."_".rand(0, getrandmax()).".".$ext[1];
(move_uploaded_file($upltmp,$upload_dir.$file_name))
}
I have XAMPP stack installed on my PC which is running WinXP, has 3 GB RAM and ample of Hard disk space.
No matter which size file I select it always give error.
What must be wrong in this code?