【发布时间】:2014-02-25 22:34:01
【问题描述】:
我想将图像上传到文件夹/images 并保留其名称
这是我得到的:
html
<form action="script.php" method="post" enctype="multipart/form-data">
<input type="file" name="mynewimage">
<input type="submit">
</form>
php
if (!empty($_FILES['mynewimage']['name'])) {
move_uploaded_file($_FILES['mynewimage']['tmp_name'], "images/" . $_FILES["mynewimage"]["name"]);
}
/images 文件夹是 777
错误提示:UPLOAD_ERR_NO_FILE
Value: 4; No file was uploaded.
【问题讨论】: