How do I upload a FilePond file field to the server along with other form elements. For example i have a form element that contains input fields, a select field, a textarea and a file input field which is connected to the Filepond plugin.
<form class="uploadform">
<input type="text" placeholder="type the title of the document you are uploading">
<textarea class="textarea" placeholder="type anything here"></textarea>
<input type="file" class="filepond" name="file[]" multiple>
<button type="button" class="uploadbtn">Upload Document</button>
</form>
But whenever i try to upload the form the file field doesn't upload with it to the server, please help me with this. How do i bind the FilePond input field to my formdata element?
This is my jQuery upload code:
$(".uploadbtn").click(function(){
var form = document.getElementsByClassName("uploadform")[0]
var formdata = new FormData(form)
$.ajax({
url: "path/to/php-server-side/request/handler.php",
data: formdata,
processData: false,
contentType: false,
method:"post"
}).done(function (response) {...
})