Hello!After I submit the form, the JPG file didn't go to the $file_dir.Please,how can I make it work?here is the code:
<html>
<head>
<title>
</title>
</head>
<?php
$file_dir="/home/llama/PHPtesting/Uploads";
$file_url="http://mili.phpwebhosting.com/~llama/PHPtesting/Uploads";
foreach($HTTP_POST_FILES as $file_name=>$file_array){
print"path:".$file_array['tmp_name']."<br>\n";
print"name:".$file_array['name']."<br>\n";
print "type:" .$file_array['type']."<br>\n";
print"size:".$file_array['size']."<br>\n";
if (is_uploaded_file($file_array['tmp_name'])
&&$file_array['type']=="image/jpg"){
move_upload_file($file_array['tmp_name'],"file_dir/$file_name")
or die("couldn't copy");
print"<img src=\"$file_url/$file_name\"><p>\n\n";
}
}
?>
<body>
<form enctype="multipart/form-data" method="post">
<input type="hidden" name="MAX_FILE_SIZE" value="51200">
<input type="file" name="fuload"><br>
<input type="submit" value="send file">
</form>
</body>
</html>