Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > HtmlInputFile accept property

Reply
Thread Tools

HtmlInputFile accept property

 
 
Garg Pankaj
Guest
Posts: n/a
 
      08-26-2003
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



 
Reply With Quote
 
 
 
 
bruce barker
Guest
Posts: n/a
 
      08-26-2003
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
>
>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
<html:file> accept property and button's label Smurf Java 5 05-11-2012 03:27 PM
Asp.net User Control or Custom control Property doesnt accept inlineasp.net constract <%= %> is there a workaround? AleXmanFree ASP .Net 3 10-09-2008 07:39 PM
htmlinputfile - accept ASP .Net Web Controls 5 01-20-2006 06:38 PM
HtmlInputFile and property's =?Utf-8?B?Q2hyaXM=?= ASP .Net 4 12-30-2004 05:33 PM
Accept properties in Property Box for Customr Validator /or any Custom Control Vinod I ASP .Net 1 02-26-2004 05:08 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57