Block Upload of File

Sep 13, 2010 at 10:54 PM

I have a scenario where the use may browse to and select a file for upload, but I want to block the upload of that file based on some business rules. I was wondering what the best way to do that would be? I am already handling the OnConfirmUpload event, but believe this is too late to keep the file from making it into S3. Would the only way to do this be to allow the upload and then manually delete the object in the ConfirmUpload handler?



Sep 23, 2010 at 9:17 PM

Look into the FileNameDetermining event; it fires before the file is uploaded and allows cancellation.

If the business rules are file size, file type, etc, then you can handle those with properties on the control.