laravel-filepond icon indicating copy to clipboard operation
laravel-filepond copied to clipboard

Allow to specify input name

Open abudawud opened this issue 2 years ago • 0 comments

Add input name filed with modifying the filepond ondata method. Here is the example

FilePond.create(document.querySelector('input.photo-file'), {
    labelIdle: 'Drag & Drop Gambar Varietas atau <span class="filepond--label-action"> Browse </span>',
    acceptedFileTypes: 'image/*',
      server: {
        url: "{{ route('filepond.chunk') }}",
        process: {
            url: '/process',
            ondata: function (form) {
                form.append('input_name', 'photo_file');
                return form;
            }
        },
        revert: '/process',
        patch: "?patch=",
        headers: {
          'X-CSRF-TOKEN': '{{ csrf_token() }}'
        }
      }
})

Refer to: https://pqina.nl/filepond/docs/api/server/#object-configuration

Solve issue #67

abudawud avatar Apr 06 '23 01:04 abudawud