- 论坛徽章:
- 0
|
通过客户端成功访问Redhat5.4 HTTP server HTML网页后,可以上传文件,并提示文件上传成功“File is valid, and was successfully uploaded”
html网页具体内容如下:
------------------------------------------------------------
<!-- The data encoding type, enctype, MUST be specified as below -->
<form enctype="multipart/form-data" action="file.php" method="POST">
<!-- MAX_FILE_SIZE must precede the file input field -->
<input type="hidden" name="MAX_FILE_SIZE" value="30000" />
<!-- Name of input element determines name in $_FILES array -->
Send this file: <input name="userfile" type="file" />
<input type="submit" value="Send File" />
</form>
----------------------------------------------------------------------------
file.php的内容如下:
---------------------------------------------------------------------------
<?php
// In PHP versions earlier than 4.1.0, $HTTP_POST_FILES should be used instead
// of $_FILES.
$uploaddir = '/home/ftp_user1/UL/';
$uploadfile = $uploaddir . basename($_FILES['userfile']['name']);
echo '<pre>';
if (move_uploaded_file($_FILES['userfile']['tmp_name'], $uploadfile)) {
echo "File is valid, and was successfully uploaded.\n";
} else {
echo "Possible file upload attack!\n";
}
echo 'Here is some more debugging info:';
print_r($_FILES);
print "</pre>";
?>
---------------------------------------------------------------------------
以上代码都是从http://www.php.net/manual/zh/features.file-upload.post-method.php复制下来的。
这个文件夹/home/ftp_user1/UL/权限全开(777)。我现在的问题是当在该文件夹下找我要文件时,并没有看到文件的存在,请问这个是怎么一回事?
谢谢。 |
|