why it shows me this error: "Undefined index: Upload" ?
I have found many posts on this topic and have revised my code but it does not work
HTML:
<form method="POST" class="formphoto" enctype="multipart/form-data">
<input type="file" name="upload" class="inputfile" id="file1">
Ajax
$('.inputfile').on('change', function(event) {
// var upload = event.target.value;
$.ajax({
type: 'POST',
method: 'POST',
url: '../MeetBlog/pages/upload_cache/upload_cache.php',
data: new FormData($(".formphoto")[0]),
cache: false,
contentType: false,
processData: false,
success: function(data) {
$('.imgshow').html(data);
},
});
});
});
PHP
<?php
session_start();
require_once __DIR__ . '/../../config/connect.php';
var_dump($_FILES['upload']['tmp_name']);
?>
This comes to the Server: