Search code examples
javascriptphpcodeigniteruploadingfilepond

Uploading using Filepond library


please after previewing i cant seem to get my choosed files in preview to be sent via the FILES header in php once i submit the form generally ...

this is the html

<div class="col-md-7">
<div class="md-form p-2 border rounded">
    <input type="file" name="images[]" id="more_images" class="my-pond-multiple" />
    <label for="files" class="active bg-white ml-2">Other Files</label>
</div>

and the me calling the file pond jquery object

$('.my-pond-multiple').filepond({
    allowMultiple: true
});

any help will be appreciated please


Solution

  • The FilePond files are not stored in the file input element, browsers don't allow setting this value (see: https://pqina.nl/blog/the-trouble-with-editing-and-uploading-files-in-the-browser/)

    You can either upload the files asynchronously by setting the FilePond server property. Or you can use the FilePond file-encode plugin, which will encode the files as base64 strings and send those to your server, you then have to turn the strings back into file objects.