473,407 Members | 2,326 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,407 software developers and data experts.

asp:FileUpload - possible to change file filter?

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
Nov 20 '05 #1
3 8842
The best way is probably to use JavaScript. The input type="file" does have
an accept attribute, but I'm nto sure how well supported it is.

JavaScript solution:
http://www.cs.tut.fi/~jkorpela/forms/file.html#filter

Everything I found on Accept was pretty old though, so IE 6.0 and Firefox
might play nicer with it.

Karl

--
MY ASP.Net tutorials
http://www.openmymind.net/
http://openmymind.net/redirector.aspx?documentId=51 - Learn about AJAX!

"Handy Andy" <sp******@spamless.com> wrote in message
news:66********************@pipex.net...
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

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

-- bruce (sqlwork.com)

"Handy Andy" <sp******@spamless.com> wrote in message
news:66********************@pipex.net...
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

Nov 20 '05 #3
That's a real nuisance.

Thanks for the replies.

Andy
Nov 20 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

13
by: Leo | last post by:
Hi I had asekd previously a question qith regards to running a DLL file from ASP. It was not running for me. Bo error returned, nothing, Just an empty string (when it should have not been...
1
by: Bill | last post by:
How can I include a .cgi file in an .ASP file? I've tried #include, Server.Transfer, and Server.Execute (yes, I know the last two are only for ASP, but I tried it anyway). If I have to, I...
8
by: Peter Gustafsson | last post by:
Hi I have a HTML-only file, and asp file that do a databasequery. How can I do a query in the html file, like this: DBLookup("2"). The asp file execute the query and respond with the result....
0
by: =?Utf-8?B?TGVvbkc=?= | last post by:
I'm trying to upload a file using an asp:FileUpload control and an asp:LinkButton. This works fine, while there is an actual filepath in the fileupload upload control. Even an empty field works....
4
by: bryanp10 | last post by:
How do I do a client-side check to see that a file exists before attempting to upload it? I am trying to avoid the "Access denied" error I get on form submission if an invalid name is entered in...
1
by: bkeller81 | last post by:
Forgive me if this has been posted but I could not find an answer. I am using <asp:FileUpload ID="FileUpload1" runat="server" /> to allow a user to select a file from their computer. I need is the...
10
by: =?Utf-8?B?cm1jb21wdXRl?= | last post by:
I have Windows 2000 and recently included Internet Information Services. I then created a simple ASP file and clicked on it. The Open With dialog appears asking me to select a program. I copied...
5
by: =?Utf-8?B?bXVzb3NkZXY=?= | last post by:
Hi guys I'm having a problem uploading files to 1&1 using the asp:FileUpload control. Currently, I have direct file writing code (FileStream) working, having set the permissions on the...
2
by: =?Utf-8?B?bXVzb3NkZXY=?= | last post by:
Hi guys This is a repost as I haven't managed to fix the problem yet. I really hope someone can help as I'm stuck. I have an asp:fileupload component on a page, and it's giving the following...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.