HtmlInputFile accept property

  • Thread starter Thread starter Garg Pankaj
  • Start date Start date
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
 
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.
 
Back
Top