Re: .accept = "image/*"

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance

From: Yama (ykamyar_at_grandpacificresorts.com)
Date: 03/15/04


Date: Mon, 15 Mar 2004 15:23:21 -0800

What is your file1 control type? Is it an INPUT of type="file" or something
else?

In your click event (submit) check for the ContentType of your uploaded file
(image in your case)
If txtFileUpload.PostedFile.ContentType ="image/jpg, image/gif" Then
    '--// Do something Response.Write("Only GIF or JPEG")
End If

Only accept this:
txtFileUpload.ACCEPT="image/jpg, image/gif"

You can also write your own .HTC (HTML script) to add a keyword such as
"Accept" for your upload textbox so that you could do the following:

<input id="txtFileUpload" type="file" size="17" name="txtFileUpload"
runat="server" width="370px" ACCEPT="image/jpg,image/gif">

Hope this helped,

Yama

"Martin" <theintrepidfox@hotmail.com> wrote in message
news:7217238c.0403150347.3a5e9390@posting.google.com...
> Dear Group
>
> file1.accept = "image/*"
> Why isn't this working? Still get a choice of 'All Files' and 'HTML'.
> What do I need to accept .jpg and .gif only?
>
> Tried file1.accept = "image/*" in Page_Load() and Initialize() with no
luck.
> File Field is running at server.
>
> Thanks for your time & efforts!
>
> Martin



Relevant Pages

  • Re: File Upload Web Service
    ... using vba with wininet api for the upload because I need the solution to ... > client(OFFICE VBA ?). ... > However, since you'd like to call the webservice in VBA application, I ... > capable of handling client uploaded file. ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Uploading JPGs
    ... I use it to upload JPG's but I have come accross the following problem. ... file types and size and it won't reconise the file type. ... I trap for... ...
    (alt.php)
  • Re: Uploading JPGs
    ... I use it to upload JPG's but I have come accross the following problem. ... file types and size and it won't reconise the file type. ... I trap for... ...
    (alt.php)
  • Re: Help with Javascript Validation. URGENT!!!
    ... I mean uploaded file i.e. i need to check either of the 2 options: ... I have a form which has one textarea for the user to enter some ... in the textarea or should have uploaded something to the server. ... If "chosen a file to upload" then you can check values of both form ...
    (comp.lang.javascript)
  • Re: Maximum file upload question
    ... I say nitpicky because I've been trying to figure out what an http request larger than ... an uploaded file but is larger than 1MB) the following web.config entry would cover all bases: ... You can, however, put the "upload file" page in its own sub-folder and put a web.config in that folder ...
    (microsoft.public.dotnet.framework.aspnet)