Code: Select all
,Code: Select all
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]
Hi all,
I am uploading a file to the server with the code below.
.
.Code: Select all
if (is_uploaded_file($_FILES['upload_image']['tmp_name']))
{
if(move_uploaded_file($_FILES['upload_image']['tmp_name'], $target_path))
{
....codes
}
else
{
echo("error: ".$_FILES['userfile']['error']);
exit;//<----i always get here. Though the echo above just results in: error: (blank -- no error?)
}
}I am assuming that my file has been uploaded, since $_FILES['upload_image']['tmp_name'] is not empty.
Also the $_FILES['userfile']['error'] is blank.
I also used the php function is_uploaded_file() to be sure that i have uploaded the file.
I have already checked the server's php.ini file, and everything seemed to be ok: file_uploads is "on", upload_max_filesize=2M, upload_tmp_dir = "no value".
$target_path == the location of my folder and my filename for the uploaded file, e.g. ../images/starcraft2.jpg
I have tested the code above before and it worked, don't know why it fails me now.
Help please??
Thanks.
Marc
feyd | Please use
Code: Select all
,Code: Select all
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]