AllowedFileTypes only for the browse dialog window

Jan 7, 2009 at 12:13 PM
The AllowedFileTypes property filters only the file types displayed in the browse file dialog window but I can still type the whole file path with non allowed file type in the file name field and it will get uploaded after all. How can I restrict the upload to specific file types? For example I don't want users to upload exe files.

Thanks in advance.
Jan 7, 2009 at 4:37 PM
<script runat="server">
protected void FileNameDetermining(object sender, FileNameDeterminingEventArgs args)
    if(!IsAllowedType(args.File)) args.CancelProcessing = true;
// or throw exception } </script> <fjx:FileUploader ID="FileUploader1" runat="server"> <Adapters> <fjx:FileSaverAdapter Runat="server" FolderName="UploadFolder" OnFileNameDetermining="FileNameDetermining" /> </Adapters> </fjx:FileUploader>
Jan 7, 2009 at 4:48 PM