Uploading files
Posted: Tue Mar 24, 2009 11:42 am
Hi guys,
I am trying to enable users to upload files via a HTML form. This is the code I am using but I am receiving an error message when the user submits:
Is there anything bviously wrong, or else how can I output the error?
Thanks in advance,
Rob.
I am trying to enable users to upload files via a HTML form. This is the code I am using but I am receiving an error message when the user submits:
Code: Select all
$root="$_SERVER[DOCUMENT_ROOT]/available";
$dir="/";
$target_path_image=$root . $dir . 'image' . $dir;
$target_path_image=$target_path_image . basename( $_FILES['uploadedimage']['name']);
if(move_uploaded_file($_FILES['uploadedimage']['tmp_name'], $target_path_image)){
echo "The main image and pdf have been successfully uploaded";
}
else{
echo "There was an error uploading the files, please try again!";
}Thanks in advance,
Rob.