我无法使用此代码
在jquery中读取文件// Html代码
< input type="file" id="UploadedImage" name="UploadedImage" accept="image/*">
// JS代码
var file_data = $("#UploadedImage").prop("files")[0];
var form_data = new FormData();
form_data.append("fileData", file_data);
jQuery.ajax({
type:'POST',
url:Drupal.settings.basePath + 'KycCallBack',
data:
{
id:"SaveKYC",
UploadedImage:form_data,
},
success:function(data)
{
jQuery(".ajaxLoading").hide();
//我希望在我的API中的php中读取这样的内容
$UploadedImage = $_FILES["UploadedImage"]["name"];
$target_dir = "sites/all/modules/vestigepos/vestigepos/KYCImages/";
$target_dir = $target_dir . basename( $_FILES["UploadedImage"]["name"]);
if (move_uploaded_file($_FILES["UploadedImage"]["tmp_name"], $target_dir)) {
echo "File Uploaded ";
}