【发布时间】:2019-12-11 04:16:30
【问题描述】:
这是我的一段代码。
进程.php
$image = $_POST['image'];
index.php
<script>
function save(){
var image = document.getElementById('image').files[0].name;
$.ajax({
type: "POST",
url: 'process.php',
data: {
image: image
},
});
}
</script>
<input type="file" class="custom-file-input" id="image" name="image">
这基本上只将文件名返回到数据库mysql,但我不知道如何将文件从文件夹A移动到文件夹B。文件夹A是图像的来源,文件夹B是当我想调用图像时,我会使用文件夹 B 的路径。
是否可以通过 $_POST 而不是 $_FILES 移动图像?因为到目前为止 我只找到 $_FILES。
【问题讨论】:
-
在
-
据我所知这是不可能的,您只能通过 $_FILES 获取文件信息
-
你不能发帖,你需要
$_FILES -
为什么要使用
$_POST? -
您想通过使用 $_POST 而不是 $_FILES 来解决什么问题?
标签: javascript php jquery mysql ajax