dangminhthang
dangminhthang
FFilament
Created by dangminhthang on 3/21/2025 in #❓┊help
Multiple images upload issue on mobile
What I did: I'm using Spatie Media File Upload to upload multiple images. My issue/the error: It works fine on PC, but when I use it on some phones and select about 14-20 images, each image ~2MB, the browser restarts itself. It works on some newer models (such as iPhone 15 Pro), but not on some older models such as iPhone 13, iPhone 11, etc. Code:
SpatieMediaLibraryFileUpload::make($name)
->collection($collection)
->moveFiles()
->maxSize(10240) // in KB (10MB)
->openable()
->uploadProgressIndicatorPosition('left')
->maxParallelUploads(1)
->fetchFileInformation(false)
->multiple()
->appendFiles()
->reorderable()
->panelLayout('grid')
->imageEditor()
->imagePreviewHeight('250')
->imageEditorAspectRatios([null, '16:9', '4:3', '1:1'])
->imageResizeTargetWidth(1024) // Reduce image width
->imageResizeTargetHeight(1024) // Reduce image height
->imageResizeMode('contain') // Keep aspect ratio
->imageResizeUpscale(false); // Do not upscale image to target width and height
SpatieMediaLibraryFileUpload::make($name)
->collection($collection)
->moveFiles()
->maxSize(10240) // in KB (10MB)
->openable()
->uploadProgressIndicatorPosition('left')
->maxParallelUploads(1)
->fetchFileInformation(false)
->multiple()
->appendFiles()
->reorderable()
->panelLayout('grid')
->imageEditor()
->imagePreviewHeight('250')
->imageEditorAspectRatios([null, '16:9', '4:3', '1:1'])
->imageResizeTargetWidth(1024) // Reduce image width
->imageResizeTargetHeight(1024) // Reduce image height
->imageResizeMode('contain') // Keep aspect ratio
->imageResizeUpscale(false); // Do not upscale image to target width and height
3 replies