Hi,
I have a simple upload script that seems to work, but it uploads the file as 0mb. Below is the script that the form post too. Anyone see anything wrong with it? I can’t figure it out, please help.
<?php
$file_dir = "/u/htdocs/path/";
foreach($_FILES as $file_name => $file_array) {
print "path: ".$file_array['tmp_name']."<br>
";
print "name: ".$file_array['name']."<br>
";
print "type: ".$file_array['type']."<br>
";
print "size: ".$file_array['size']."<br>
";
if (is_uploaded_file($file_array['tmp_name'])) {
move_uploaded_file($file_array['tmp_name'],
"$file_dir/$file_array[name]") or die ("Error, it seems there was a problem");
print "file was moved!<br><br>";
}
}
?>
Thanks.