473,508 Members | 3,343 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

File Upload Control

I would like to limit the file types that users can upload.

<input id="tbFileUpload" type="file" runat="server">

This setting looks like it should it work, but it's not working for me.

tbFileUpload.Accept = "gif,bmp";

Any suggestions?
Nov 19 '05 #1
5 2803
while the w3c has defined this attribute, neither IE or firefox support it.

-- brce (sqlwork.com)
"Jon Natwick" <no**********@yahoo.com> wrote in message
news:z3*******************@tornado.rdc-kc.rr.com...
| I would like to limit the file types that users can upload.
|
| <input id="tbFileUpload" type="file" runat="server">
|
| This setting looks like it should it work, but it's not working for me.
|
| tbFileUpload.Accept = "gif,bmp";
|
| Any suggestions?
|
|
Nov 19 '05 #2
The Accept property of an HtmlInputFile object is a comma-delimited list of
MIME types. "gif" and "bmp" are not MIME types; they are file extensions.
Here's what you need to put:

tbFileUpload.Accept = "image/gif,image/bmp";

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
What You Seek Is What You Get.

"Jon Natwick" <no**********@yahoo.com> wrote in message
news:z3*******************@tornado.rdc-kc.rr.com...
I would like to limit the file types that users can upload.

<input id="tbFileUpload" type="file" runat="server">

This setting looks like it should it work, but it's not working for me.

tbFileUpload.Accept = "gif,bmp";

Any suggestions?

Nov 19 '05 #3

"bruce barker" <no***********@safeco.com> wrote in message
news:Oa*************@TK2MSFTNGP15.phx.gbl...
while the w3c has defined this attribute, neither IE or firefox support
it.

-- brce (sqlwork.com)
"Jon Natwick" <no**********@yahoo.com> wrote in message
news:z3*******************@tornado.rdc-kc.rr.com...
| I would like to limit the file types that users can upload.
|
| <input id="tbFileUpload" type="file" runat="server">
|
| This setting looks like it should it work, but it's not working for me.
|
| tbFileUpload.Accept = "gif,bmp";
|
| Any suggestions?
|
|

Nov 19 '05 #4
Kevin,

Thanks for the reply!

I think I see what you mean by using the MIME types.

http://msdn.microsoft.com/workshop/a...ies/accept.asp

However, I still haven't been able to get it work.

Could there be server setting also?

Thanks

"Kevin Spencer" <ke***@DIESPAMMERSDIEtakempis.com> wrote in message
news:%2****************@TK2MSFTNGP15.phx.gbl...
The Accept property of an HtmlInputFile object is a comma-delimited list
of MIME types. "gif" and "bmp" are not MIME types; they are file
extensions. Here's what you need to put:

tbFileUpload.Accept = "image/gif,image/bmp";

--
HTH,

Kevin Spencer
Microsoft MVP
.Net Developer
What You Seek Is What You Get.

"Jon Natwick" <no**********@yahoo.com> wrote in message
news:z3*******************@tornado.rdc-kc.rr.com...
I would like to limit the file types that users can upload.

<input id="tbFileUpload" type="file" runat="server">

This setting looks like it should it work, but it's not working for me.

tbFileUpload.Accept = "gif,bmp";

Any suggestions?


Nov 19 '05 #5
Honestly, Jon, I don't know. I've never used it. I always use JavaScript
validation, and check the "value" property of the File Upload before sending
it.

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
What You Seek Is What You Get.

"Jon Natwick" <no**********@yahoo.com> wrote in message
news:Ja*******************@tornado.rdc-kc.rr.com...
Kevin,

Thanks for the reply!

I think I see what you mean by using the MIME types.

http://msdn.microsoft.com/workshop/a...ies/accept.asp

However, I still haven't been able to get it work.

Could there be server setting also?

Thanks

"Kevin Spencer" <ke***@DIESPAMMERSDIEtakempis.com> wrote in message
news:%2****************@TK2MSFTNGP15.phx.gbl...
The Accept property of an HtmlInputFile object is a comma-delimited list
of MIME types. "gif" and "bmp" are not MIME types; they are file
extensions. Here's what you need to put:

tbFileUpload.Accept = "image/gif,image/bmp";

--
HTH,

Kevin Spencer
Microsoft MVP
.Net Developer
What You Seek Is What You Get.

"Jon Natwick" <no**********@yahoo.com> wrote in message
news:z3*******************@tornado.rdc-kc.rr.com...
I would like to limit the file types that users can upload.

<input id="tbFileUpload" type="file" runat="server">

This setting looks like it should it work, but it's not working for me.

tbFileUpload.Accept = "gif,bmp";

Any suggestions?



Nov 19 '05 #6

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

Similar topics

20
2438
by: CHIN | last post by:
Hi all.. here s my problem ( maybe some of you saw me on other groups, but i cant find the solution !! ) I have to upload a file to an external site, so, i made a .vbs file , that logins to...
1
2541
by: TK | last post by:
I have a file upload control to allow a user to select/upload a file to the server. They need to upload x number of files in one shot because they have to confirm that they are uploading x number...
13
4281
by: Sky Sigal | last post by:
I have created an IHttpHandler that waits for uploads as attachments for a webmail interface, and saves it to a directory that is defined in config.xml. My question is the following: assuming...
5
3393
by: George Durzi | last post by:
Anyone know of a good file upload control? I don't like using the built in one because it's unable to maintain state on a refresh. Thanks!
3
2834
by: Bijoy Naick | last post by:
I've written a simple file upload user control in VB .NET. It comprises of an InputFile HTML Server Control, an Upload button and a message label. User clicks on the Browse button of the...
3
2524
by: Sarav | last post by:
Hi All, I need to upload an XML file via an client side ActiveX control. I searched the web but everywhere got the samples of using file control alone. How can I upload a file into my web server...
12
2460
by: GuangXiN | last post by:
I want the file upload element disappear, instead of it, I place a text box and a button with my own css defination. but it doesn't work on IE7. What should I do now? <form action="upload.php"...
7
7124
Curtis Rutland
by: Curtis Rutland | last post by:
Building A Silverlight (2.0) Multi-File Uploader All source code is C#. VB.NET source is coming soon. Note: This project requires Visual Studio 2008 SP1 or Visual Web Developer 2008 SP1 and...
0
7398
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...
0
7502
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
5637
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,...
1
5057
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...
0
4716
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...
0
3208
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...
0
3194
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1566
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 ...
1
769
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.