[英]Upload multiple files cannot append the files data and upload into selected folder
我创建了一个表单让用户插入文档和照片,我的问题是我只能 append 表格中的文档数据并上传到所选文件夹,但我不能 append 表格中的照片数据并上传到所选文件夹,结果如下图,表中的照片数据不能为append:
实际上,我想要如下图所示的结果:
这是我的前端jsfiddle https://jsfiddle.net/9fztkn60/2/
下面是我的后端:
<?php
if(isset($_POST) && $_SERVER['REQUEST_METHOD'] == "POST")
{
$vpb_file_name = strip_tags($_FILES['upload_file']['name']); //File Name
$vpb_file_id = strip_tags($_POST['upload_file_ids']); // File id is gotten from the file name
$vpb_file_size = $_FILES['upload_file']['size']; // File Size
$vpb_uploaded_files_location = 'C:/xampp/htdocs/uploads_test/'; //This is the directory where uploaded files are saved on your server
$vpb_final_location = $vpb_uploaded_files_location . $vpb_file_name; //Directory to save file plus the file to be saved
//Without Validation and does not save filenames in the database
if(move_uploaded_file(strip_tags($_FILES['upload_file']['tmp_name']), $vpb_final_location))
{
//Display the file id
echo $vpb_file_id;
}
else
{
//Display general system error
echo 'general_system_error';
}
}
?>
希望有人可以指导我在上传照片部分中我出错的部分。 谢谢。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.