473,405 Members | 2,171 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,405 software developers and data experts.

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 2794
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
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
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
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
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
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
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
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
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
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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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.