请教一个文件存储路径的问题
通过客户端成功访问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)。我现在的问题是当在该文件夹下找我要文件时,并没有看到文件的存在,请问这个是怎么一回事?
谢谢。 error_reporting(E_ALL) 上传后的文件的名字 和 你在本地的名字 不一样的 系统重命名了 谢谢3楼的回复。
我想,就算是上传文件名字给改掉了,但是在上传文件存储路径下'/home/ftp_user1/UL/'应该可以找到文件的吧,我这边什么都看不到。
页:
[1]