03-19-2018, 08:26 PM
(03-18-2018, 06:00 PM)davenovo Wrote: Hi Daniel,
Thank for the help. But that is not exactly what I wanted. In the case above, you are setting FileRejected to True AFTER the file is uploaded. Why go through the bother of letting them upload a 100 Mb file if I know I am going to reject it. For example, if I know I only allow files with the word "apple" somewhere in the filename, I should be able to abort the file upload before it starts if the filename does not contain the word apple.
OnAsyncSelectFile event happens BEFORE the file has been uploaded. It occurs immediately after anything has been selected at browser side, but before any update takes place. This is the exact moment to validate anything.
Besides that AllowedExtensions, MinFileSize and MaxFileSize can limit the possible extensions and file size, without any communication to the server.

