I wrote the follow 2 simple pages:
1.
<html>
<form enctype="multipart/form-data" action="myupload.php" method="post">
<input type="hidden" name="MAX_FILE_SIZE" value="2000000" />
Send this file: <input name="userfile" type="file" />
<input type="submit" value="Send File" />
</form>
</html>
2.
<html>
<?php
$uploaddir = '/diskh/zco/cogl2/public_html/';
$uploadfile = $uploaddir . $_FILES['userfile']['name'];
print "<pre>";
if (move_uploaded_file($FILES['userfile']['tmp_name'], $uploadfile)) {
print "File is valid, and was successfully uploaded. ";
print "Here's some more debugging info:\n";
print_r($FILES);
} else {
print "Possible file upload attack! Here's some debugging info:\n";
print_r($_FILES);
}
print "</pre>";
?>
</html>
when i tired them on my localhost, they worked well, the file was uploaded. However when I upload the two pages to a remote server, and tired to upload the files to the dir:
/diskh/zco/cogl2/public_html/
it did not work. I just suspect that the path '/diskh/zco/cogl2/public_html/' on the linux server might not be correct, but I do not know how to solve it.
Thank you so much for your help!!!