HtmlInputFile accept property

Discussion in 'ASP .Net' started by Garg Pankaj, Aug 26, 2003.

  1. Garg Pankaj

    Garg Pankaj Guest

    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
     
    Garg Pankaj, Aug 26, 2003
    #1
    1. Advertising

  2. Garg Pankaj

    bruce barker Guest

    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.

    "Garg Pankaj" <> wrote in message
    news:...
    > 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
    >
    >
    >
     
    bruce barker, Aug 26, 2003
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Vinod I
    Replies:
    1
    Views:
    387
    Brian K. Williams
    Feb 26, 2004
  2. =?Utf-8?B?Q2hyaXM=?=

    HtmlInputFile and property's

    =?Utf-8?B?Q2hyaXM=?=, Dec 30, 2004, in forum: ASP .Net
    Replies:
    4
    Views:
    2,309
    Kevin Spencer
    Dec 30, 2004
  3. Smurf
    Replies:
    5
    Views:
    11,824
    isoft
    May 11, 2012
  4. AleXmanFree
    Replies:
    3
    Views:
    591
    Hillbilly
    Oct 9, 2008
  5. Guest

    htmlinputfile - accept

    Guest, Jun 5, 2005, in forum: ASP .Net Web Controls
    Replies:
    5
    Views:
    460
    bugmenot
    Jan 20, 2006
Loading...

Share This Page