meteor-file-collection icon indicating copy to clipboard operation
meteor-file-collection copied to clipboard

Larger than maxUploadSize error reporting

Open ignl opened this issue 8 years ago • 2 comments

Hi, I have a collection with set maxUploadSize option. I wonder if that should be enough and insert callback should return an error or I do need to do some manual check and error reporting for the user on client? Because right now file with length = 0 is inserted into database with no error if I upload larger than allowed file.

ignl avatar Jul 09 '16 18:07 ignl

I currently just added a check on client with error reporting if file is too big and same with validating contentType except same check additionally on allow rules for contentType.

ignl avatar Jul 11 '16 21:07 ignl

Hi, you should certainly do file size checking in the client code, and refrain from inserting the zero-length file if the proposed upload is too large.

The server-side check exists to prevent abuse (i.e. you can never really trust client-side code in the hands of an adversary.) But under normal circumstances, a client-side check should be catching an oversized request before anything ever touches the server.

vsivsi avatar Jul 11 '16 21:07 vsivsi