473,793 Members | 2,742 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 8863
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******@spaml ess.com> wrote in message
news:66******** ************@pi pex.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******@spaml ess.com> wrote in message
news:66******** ************@pi pex.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
2140
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 empty). I created a .vbs file and put it in the same directory as the .asp file on the web. The same exact code. It runs fine. Soon as I call the asp file, it still does nothing. Would anyone have an idea as to why the .asp has no ability to run this...
1
1631
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 guess I'll use ASPHTTP to do an http call to the file but first I wanted to see if there was a more elegant way to do it...! Is there an efficient way to include the output of a .cgi file in an ASP file?
8
2274
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. Send it back to the htmlfile and put it were the "DBLookup("2")" is. I can not have any asp code in the html page.
0
1577
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. But a bogus filename results in the "Access Denied" javascript error in IE7. This also happens when I use an asp:Button with the UseSubmitBehavior property set to false. When the UseSubmitBehavior is set to true (default), the button does...
4
6592
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 the textbox. This page does it beautifully: http://msconline.maconstate.edu/tutorials/ASPNET2/ASPNET09/aspnet09-11.aspx But how???
1
3297
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 Fully Qualified Path in order to attach it to an e-mail. When I use an older version of IE PostedFile.FileName returns the entire path but in Firefox it only returns the filename(including extension) Does anyone know how to obtain the fully...
10
2163
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 an existing ASP file, test.ASP from another computer where it runs successfully. When I copied it to my computer it changed to test.ASP auto file. The other computer runs Windows XP. I am not sure is this is the issue. I verified the IIS is...
5
3308
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 directory for the NETWORK SERVICE account. However, the asp:FileUpload still fails with the following error... ERROR: Request for the permission of type
2
1539
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 security exception... ERROR: Request for the permission of type 'System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.0.0,
0
9671
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9518
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10212
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9035
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7538
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6777
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5436
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4112
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3720
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.