- Set 50 Mb of file size upload limit.
- Choose two files that are together more than 50 Mb's. (2020_02_17_13_41_21_Window.png)
Result: No error message about file size upload limit bypassing.
Possible to bypass file size upload limit by uploading multiple files at once
Show previous comments
(0)
Comments
(0)
Sign in to comment on this post
Answers approved by surveyjs Support
Hello,
The maxSize
option applies to each selected file, not to the whole size. You can introduce a new property, let's say totalSize
. You can check this property in the onUploadFiles
event handler before start uploading and inform user about limit exceed.
A new property can be added via the following code:
JavaScriptSurvey.Serializer.addProperty("file", "maxSize:number");
and can be accessed via the question.maxSize
code.
Does it fit your needs?
Thanks, Serge
SurveyJS Team
Comments
(3)
GO
5 years ago
Hi,
Is it possible to force the File field to show the error message in case if we implement the custom check? If not is there a way to show custom error messages?
Regards
Gergő Oroszi
ST
5 years ago
Hello,
Sure. Here is the code:
JavaScriptquestion.errors.push(new Survey.ExceedSizeError(question.maxSize, question));
Thanks, Serge
SurveyJS Team