【发布时间】:2020-03-13 02:10:49
【问题描述】:
<?php
if (isset($_FILES['file'])) {
$file_name = $_FILES['file']['name'];
$file_tmp = $_FILES['file']['tmp_name'];
$upload_folder = "images/";
$move_file = move_uploaded_file($file_tmp, "$upload_folder/$file_name");
if ($move_file) {
echo "The file has been uploaded.";
} else {
echo "Sorry, there was an error uploading your file.";
}
}
?>
<!DOCTYPE html>
<html>
<body>
<form method="post" enctype="multipart/form-data">
Select image to upload:
<input type="file" name="file" id="file">
<input type="submit" value="Upload Image" name="submit">
</form>
</body>
</html>
这是欧元 警告:move_uploaded_file(images//489452.jpg):无法打开流:第 7 行 /Applications/XAMPP/xamppfiles/htdocs/ncs_project/test.php 中的权限被拒绝
警告:move_uploaded_file(): Unable to move '/Applications/XAMPP/xamppfiles/temp/php5kvoOW' to 'images//489452.jpg' in /Applications/XAMPP/xamppfiles/htdocs/ncs_project/test.php on line 7
【问题讨论】: