How to validate max size images individually?

SpatieMediaLibraryFileUpload::make('carousel')
->multiple()
->maxSize(4096)
SpatieMediaLibraryFileUpload::make('carousel')
->multiple()
->maxSize(4096)
for each uploaded image, i want it to not overpass 4096, is that possible anyhow or it will just set the max size for all images?
8 Replies
einnlleinhatt_
einnlleinhatt_13mo ago
Isn't that alrd working ? It multiple image uploaded it will check each image size limit
ericmp #2
ericmp #2OP13mo ago
@einnlleinhatt_ , u assume it will check each image size limit or u know it? like, setting multiple makes that 4096 is being multiplied by the amount of files i upload? im trying to check it in the vendor, but i think it doesnt
toeknee
toeknee13mo ago
maxSize should be individual image size.
ericmp #2
ericmp #2OP13mo ago
okay, now i was doing this xd:
->maxFiles(15)
->maxSize(15 * 4096)
->maxFiles(15)
->maxSize(15 * 4096)
toeknee
toeknee13mo ago
lol
ericmp #2
ericmp #2OP13mo ago
(,:
toeknee
toeknee13mo ago
It would make zero sense to set an overall file size limit
ericmp #2
ericmp #2OP13mo ago
🤷 sorry hehe thanks for the help y'all
Want results from more Discord servers?
Add your server