asp:FileUpload - possible to change file filter?

H

Handy Andy

Anyone know how to change the list of file types displayed by the
asp:FileUpload control in its file selection dialog, or am I stuck with 'All
Files(*.*) Pictures (*.gif, *.jpg) HTML (*.htm, *.html)'?

TIA

Andy
 
B

Bruce Barker

while there is an accept attribute on the file input, no browser i know
supports its. you're stuck.

-- bruce (sqlwork.com)
 
Joined
Aug 9, 2006
Messages
1
Reaction score
0
Try this

Try
<asp:RegularExpressionValidator
id="FileUpLoadValidator" runat="server"
ErrorMessage="Somente fotos JPG e GIF."
ValidationExpression="^(([a-zA-Z]:)|(\\{2}\w+)\$?)(\\(\w[\w].*))(.jpg|.JPG|.gif|.GIF)$"
ControlToValidate="FileUpload1"></asp:RegularExpressionValidator>
 
Joined
Dec 4, 2007
Messages
1
Reaction score
0
slt,
ValidationExpression="^(([a-zA-Z]|(\\{2}\w+)\$?)(\\(\w[\w].*))(.jpg|.JPG|.gif|.GIF)$"
j'ai ressayer ce que tu as ecrit pas ça marche pas :-(
 
Joined
May 5, 2009
Messages
1
Reaction score
0
Try this

ValidationExpression="^(([a-zA-Z]:)|(\\{2}\w+)\$?)(\\(\w[\w].*))(.pdf|.PDF)$"
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,764
Messages
2,569,564
Members
45,040
Latest member
papereejit

Latest Threads

Top