HtmlInputFile accept property

G

Garg Pankaj

Hi,

My problem is,

I have to upload the *.med files through an asp.net page. It means when user
click on browse button, file dialog bos should show only *.med files.

I have written this line in my aspx page,

<INPUT id="fileImport" type="file" name="fileImport" runat="server">

I have found accept propert of HTMLInputFile control,
I am trying to set this property in page load of code behind, like this,

FileImport.Accept ="*.Med"

But it does not seems to work, is there any other solution, or I am doing
something wrong, I was browsing the net, i have found somewhere that
"Accept" property works only with Netscape, not with IE. is it true.

Please provide any solution.

Thanks,
Pankaj Garg
 
B

bruce barker

you are correct, IE does not suuport this optional feature. also you
specify the mime type, not the file extension.

<INPUT id="fileImport" type="file" name="fileImport" runat="server"
accept="text/html">


accept is an html 4.0 hint to the browsers, and specifies mime-types not
extensions.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,483
Members
44,901
Latest member
Noble71S45

Latest Threads

Top