There is no perfect method to restrict the user from uploading user some malicious file. one of the better way is to use the asp's regular expression validator.
ErrorMessage="Only .doc files are
allowed!"
ValidationExpression="^(([a-zA- Z]:)|(\\{2}\w+)\$?)(\\(\w[\w ].*))+(.doc|.DOC|.DOCX|.docx)$"
ControlToValidate="File1">
ErrorMessage="This is a required field!"
ControlToValidate="File1">
No comments:
Post a Comment