Ok here's the script i've used:
<?
$file_dir = "/folder1/folder2/blah";
$file_url = "http://www.my-site.com/folder";
if ( isset( $fupload ) )
{
print "path: $fupload<br>\n";
print "name: $fupload_name<br>\n";
print "size: $fupload_size<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_url/$fupload_name\"><p>\n\n";
}
}
?>
<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="Upload">
</form>
I'm pretty sure the script works fine, but when the image has meant to be finished uploading, it says the file size is 0, and it doesn't display the image. When i look at it with my FTP browser, i can see the file, but it's file size is 0. What is wrong here? How can i fix then problem?
Thanks,
Mick
mick@micksworld.com
http://www.micksworld.com