I am using a jQuery script to upload files to a new page. It somehow works too, but the issue is that it sends the form data as object FormData.
object FormData
Here i
you should only submit the file - not the complete form
var fileInput = $('#image'); var file = fileInput.files[0]; var formData = new FormData(); formData.append('file', file);
EDIT