File Size Limit - After Resize

Started by mercactor1 reply56 views
mercactorOriginal post
#1

I would like to impose a 1MB file size limit for file uploads. The images get resized, So, most of the files are larger before the resize but smaller than 1MB after resize. Is it possible to configue uppy to check file size restrictions AFTER resize but BEFORE uplaod to the server?

johnsmith
#2

Uppy’s restrictions are evaluated on the originally selected file, so maxFileSize can’t be applied to the resized output before upload. The resize happens in the Transloadit Assembly after Uppy has handed off the file. You’d need to either allow the larger original and enforce the 1 MB limit on the resized result in the Assembly/server side, or do the resize client-side before Uppy’s restriction check with a custom plugin. There isn’t a Uppy config flag for “check after Transloadit resize but before upload” because those are separate stages.