Uploading Script!

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

i have a script that runs ok on the lycos webserver, but due to it
being unreliable, i've moved to another free server for testing. the
script is as follows:

PHP Code:

$store_dir = BASE_DIR."gallery/images/";

#check if the string of the file name given is more than one.
if( strlen($_POST['upfile']['name']) < 1 )
   echo("Error! No files to upload... Exiting");
#check the directory exists
if( !is_dir($store_dir) )
   echo("Specified directory is not valid... Exiting");
#copying the file
if( @copy($_POST['upfile']['tmp_name'] ,
               $store_dir.$_POST['upfile']['name'] ) )
   echo("Uploaded ".$_POST['upfile']['name']." successfully.");
   echo("Upload of ".$_POST['upfile']['name']." to ".$store_dir."
echo BASE_DIR;

and form:

PHP Code:
<form enctype="multipart/form-data" action="do_upload.php"
<input type="hidden" name="MAX_FILE_SIZE" value="8192">
<input name="upfile" type="file">
<input name="store_dir" type="hidden" value="/images/">
<input type="submit" value="Send File">
<input type="reset" value="reset">

but the problem is, the postdata is not being read by the script as it
exits at the first IF statement saying there is no file.



Site Timeline