473,667 Members | 2,562 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="tbFileUploa d" type="file" runat="server">

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

tbFileUpload.Ac cept = "gif,bmp";

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

-- brce (sqlwork.com)
"Jon Natwick" <no**********@y ahoo.com> wrote in message
news:z3******** ***********@tor nado.rdc-kc.rr.com...
| I would like to limit the file types that users can upload.
|
| <input id="tbFileUploa d" type="file" runat="server">
|
| This setting looks like it should it work, but it's not working for me.
|
| tbFileUpload.Ac cept = "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.Ac cept = "image/gif,image/bmp";

--
HTH,

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

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

<input id="tbFileUploa d" type="file" runat="server">

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

tbFileUpload.Ac cept = "gif,bmp";

Any suggestions?

Nov 19 '05 #3

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

-- brce (sqlwork.com)
"Jon Natwick" <no**********@y ahoo.com> wrote in message
news:z3******** ***********@tor nado.rdc-kc.rr.com...
| I would like to limit the file types that users can upload.
|
| <input id="tbFileUploa d" type="file" runat="server">
|
| This setting looks like it should it work, but it's not working for me.
|
| tbFileUpload.Ac cept = "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***@DIESPAMM ERSDIEtakempis. com> wrote in message
news:%2******** ********@TK2MSF TNGP15.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.Ac cept = "image/gif,image/bmp";

--
HTH,

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

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

<input id="tbFileUploa d" type="file" runat="server">

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

tbFileUpload.Ac cept = "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**********@y ahoo.com> wrote in message
news:Ja******** ***********@tor nado.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***@DIESPAMM ERSDIEtakempis. com> wrote in message
news:%2******** ********@TK2MSF TNGP15.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.Ac cept = "image/gif,image/bmp";

--
HTH,

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

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

<input id="tbFileUploa d" type="file" runat="server">

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

tbFileUpload.Ac cept = "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
2481
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 the site, and then i have to select the file to upload.. i used sendkeys.. and i worked perfect.. BUT ... the computer must be locked for security ( obviusly ) reazons.. so..i think this probable solutions to unlock the computer and run the...
1
2549
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 files for processing. So I do not want the files to be uploaded until the user presses a submit button verifying that they want to submit x number of files for processig (processing refers to me doing something to the files once uploaded). Catch...
13
4297
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 that this is suppossed to end up as a component for others to use, and therefore I do NOT have access to their global.cs::Session_End() how do I cleanup files that were uploaded -- but obviously left stranded when the users aborted/gave up writting...
5
3402
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
2841
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 InputFile control, selects a file, then clicks on the Upload button. The file is saved to a folder on the server and the message label displays the appropriate msg. The user control also has a SetFilePath method.. This is used by the page which includes...
3
2533
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 without using the <input type ="file" ....> control. I need the same for Download also. Without displaying the Save as dialog box. Why I am asking this is I am going to handle this with my Client side ActiveX control.
12
2482
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" method="POST" enctype="multipart/form-data"> <p> <span>Select photo:</span> <input type="file" name="photo" style="display:none;"> <input type="text" name="photoUrl" class="s1" /> <input type="button" class="s2"...
7
7147
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 Silverlight 2.0. To get these tools please visit this page Get Started : The Official Microsoft Silverlight Site and follow Step 1. Occasionally you find the need to have users upload multiple files at once. You could use multiple FileUpload...
0
8365
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
8788
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
8646
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7390
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
6203
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
4372
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2776
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
2013
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1778
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.