rahulhaque / laravel-filepond

Use FilePond the Laravel way.
MIT License
185 stars 31 forks source link

Fix Compatibility Issue with Non-Local Temp Disks #61

Closed viicslen closed 2 months ago

viicslen commented 2 months ago

This pull request addresses a compatibility issue introduced by a recent fix for uploading large files. The previous implementation retrieved the path from the disk driver and attempted to instantiate a File object, which only references a path in the local filesystem and therefore caused problems with non-local temp disks (e.g., S3).

https://github.com/rahulhaque/laravel-filepond/blob/4a6f7a7b265b5631c567263d81644c416a5c1d04/src/Filepond.php#L188

Changes made:

https://github.com/viicslen/laravel-filepond/blob/76467992739ef90bdeabef797853d3e97e789bc4/src/Filepond.php#L187-L191

This change ensures compatibility with both large file uploads and external temp disks, avoiding the need to reference local filesystem paths.

rahulhaque commented 2 months ago

@viicslen to test it properly, I need to know 2 things. What is your temp and permanent disk in filepond config?

viicslen commented 2 months ago

Both are S3 Object storage drivers

Edit: MinIO would also be affected, and FTP/SFTP quite possibly as well since the Storage::path does't reference the driver that it's using, it just returns the path of the file in whichever server/service is being used

rahulhaque commented 2 months ago

@viicslen thank you for this. I'm planning to include some test cases. I'll merge the changes asap.