problem about not getting the uploadfile address...
This is my code where i am uploading the file and trying to copying it into another direcotry. But i am facing a problem. The problem is that my uploaded file address is lost when i am checking for copying.. Also i need help about "how do i get the name,size and type of the uploading file? Help me please..............
************************************************** **************
<html>
<head>
<title>A file upload script</title>
</head>
<?php
$file_dir = "c:/wamp/tmp"; // this is new copy address.
$fupload = $_POST['fupload'];
echo "<br> printing the upload directory address: $fupload";
if ( isset( $fupload ) )
{
print "path: $fupload<br>\n";
print "name: $fupload_name<br>\n";
print "size: $fupload_size bytes<br>\n";
print "type: $fupload_type<p>\n\n";
if ( $fupload_type == "image/gif" )
{
copy ( $fupload, "$file_dir/$fupload_name") or die ("Couldn't copy");
print "<img src=\"$file_dir/$fupload_name\"><p>\n\n";
}
}
?>
<body>
<form enctype="multipart/form-data" action="<?php print $PHP_SELF?>" method="POST">
<input type="hidden" name="MAX_FILE_SIZE" value="51200">
<input type="file" name="fupload"><br>
<input type="submit" value="Send file!">
</form>
</body>
</html>
************************************************** ***************
|