Link to home
Start Free TrialLog in
Avatar of stathisx
stathisxFlag for Greece

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?
Avatar of Tony Barkdull
Tony Barkdull
Flag of United States of America image

In you file upload, use this to specify type and size. This is from my asp page

'The the properties of the upload
File.ValidFileTypes = "jpg,gif,png"
File.MaxSize = 1024*1024
File.Overwrite = false 'Do not overwrite, create unique filename
SOLUTION
Avatar of stathisx
stathisx
Flag of Greece image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of stathisx

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.