Skip to content

Improve chunked uploads

Latest
Compare
Choose a tag to compare
@Sopamo Sopamo released this 30 Apr 10:15
714d00f

Improve chunked uploads:

  • Add ability to send the original file name, which is then used for automatic mime type detection
  • Reduce memory usage by streaming chunks to a temporary local file and then streaming the final file to the final storage disk

To use the new mime type detection, update your filepond js config:

FilePond.setOptions({
  server: {
    url: '/filepond/api',
    process: {
      url: "/process",
      headers: (file: File) => {
        // Send the original file name which will be used for chunked uploads
        return {
          "Upload-Name": file.name,
          "X-CSRF-TOKEN": "{{ csrf_token() }}",
        }
      },
    },
    revert: '/process',
    patch: "?patch=",
    headers: {
      'X-CSRF-TOKEN': '{{ csrf_token() }}'
    }
  }
});