我正在尝试将文件上传到目录但我一直收到错误或控制台
GET http://localhost:9999/store/uploads/.jgp
虽然我的HTML是
<form action="" method="POST" id="formSettingStoreLogo" enctype="multipart/form-data">
<div>
<p>Put a logo </p>
<br />
<input type="file" name="logo" />
<input type="submit" name="submitLogo" id="submitLogo" value="Upload" />
</div>
</form>
php的代码是
$target_dir = "../uploads/store/logo/";
$target_file = $target_dir . basename($_FILES["logo"]["name"]);
$uploadOk = 1;
$imageFileType = pathinfo($target_file,PATHINFO_EXTENSION);
if (move_uploaded_file($_FILES["logo"]["name"], $target_file)) {
echo "\n"."The file ". basename( $_FILES["logo"]["name"]). " has been uploaded.";
} else {
echo "Sorry, there was an error uploading your file.";
}
了解更多信息
我上传图片的脚本位于
C:/wamp64/www/store/settingstore.php
我要上传照片的位置是
C:/wamp64/www/uploads/store/logo