Я пытаюсь загрузить файлы на удаленный сервер с помощью php, и при загрузке я получаю эту ошибку Undefined index: file
PHP
ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
error_reporting(E_ALL);
$target_path = "uploads/";
$target_path = $target_path . basename( $_FILES['file']['name']);
if (move_uploaded_file($_FILES['file']['tmp_name'], $target_path)) {
echo "Upload and move success";
} else {
echo $target_path;
echo "There was an error uploading the file, please try again!";
}
TS
var options1 = {
fileKey: 'file',
fileName: 'name.jpg',
headers: {}
}
fileTransfer.upload(fileUri, this.global.baseUrl+'upload_photo_report.php', options1)
.then((data) => {
this.img = data.response
}
Может кто-нибудь помочь мне с тем, как заставить загрузку файла работать как надо. Спасибо