473,387 Members | 1,812 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,387 software developers and data experts.

How to filter file types when using the HTMLInputFile control...

On my Web Servers, I don't want to allow visitors to upload executables.
There are many types of files that i want to ignore (for instance: exe,dll,
bat, cmd .etc). I have an ASPX page with an HTMLInputFile control which
uploads the files. Is it possible to set a filter when the user clicks the
Browse button so that the
file selection dialog only displays valid formats specified.

thankx in advance

Asela Gunawardena.
Dec 20 '05 #1
1 1859
Try using the Accept property of the HtmlInputFile control. I have never
used it, but it sounds like what you are looking for. You can probably find
the details in the Help files. Good Luck!
--
Nathan Sokalski
nj********@hotmail.com
http://www.nathansokalski.com/

"Asela Gunawardena" <sp***********@grs-lanka.com> wrote in message
news:ua**************@TK2MSFTNGP12.phx.gbl...
On my Web Servers, I don't want to allow visitors to upload executables.
There are many types of files that i want to ignore (for instance:
exe,dll,
bat, cmd .etc). I have an ASPX page with an HTMLInputFile control which
uploads the files. Is it possible to set a filter when the user clicks the
Browse button so that the
file selection dialog only displays valid formats specified.

thankx in advance

Asela Gunawardena.

Dec 21 '05 #2

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...
2
by: news.bellatlantic.net | last post by:
I created a for with file inputs (<input type=file.../>) I named them file1, file2, file3 etc. How do I access them in the code behind without actually calling each one by name (there are 21 of...
4
by: Amar | last post by:
I am trying to upload a file to the webserver through my asp.net application. The file upload works fine for files below 50 MB size because i have set the maxrequestlength property of the...
3
by: | last post by:
Thanks Richard and Shan, I am using the HtmlInputFile control.But Shan where exactly do you want me to put in your code? becoz,after the user selects a file to upload and hits Submit, then the...
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...
5
by: Grant Harmeyer | last post by:
I have an application that uses FreeTextBox 2.0 (http://www.freetextbox.com). FreeTextBox is a rich text editor that behaves similarly to MS Word. The FreeTextBox control has a button to insert...
2
by: dhnriverside | last post by:
Hi I'm trying to restrict file types with a HtmlInputFile Accept property. It seems that this isn't supported for IE6? (doh!). Can anyone recommend any free Upload components? Or a solution? ...
10
by: Paul | last post by:
Hi I am using the HtmlInputFile control to upload a file from a client to a server. I have a browse to find the file on the server but need to create the path dynamically as to were it will go...
4
by: Chris | last post by:
Hello, I am using asp.net. I have been searching this for a while, but dint find any solution yet. Any help will be appreciated. I have a string variable say 'myFile' that has complete path of...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
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...

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.