stathisx
asked on
Prevent certain data types from Attachment field
Hello experts ,
is there any way to prevent user from uploading certain data types to the attachment field? i want to insert only picture files and reject all other file types supported by the attachment field by showing a warning message.
How can this be achieved?
is there any way to prevent user from uploading certain data types to the attachment field? i want to insert only picture files and reject all other file types supported by the attachment field by showing a warning message.
How can this be achieved?
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
i found that the filedata property for the attachment field does what i really wanted. so in before update event of the attachment field a used this code to validate the attachment uploaded and if does not meet my criteria to reject it.
'The the properties of the upload
File.ValidFileTypes = "jpg,gif,png"
File.MaxSize = 1024*1024
File.Overwrite = false 'Do not overwrite, create unique filename