为什么文件不在目录中上传?

时间:2016-10-18 14:51:19

标签: php

我正在尝试将文件上传到目录但我一直收到错误或控制台

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

0 个答案:

没有答案