Re: .accept = "image/*"
From: Yama (ykamyar_at_grandpacificresorts.com)
Date: 03/15/04
- Next message: Lloyd Sheen: "Re: ASP eating Javascript from VB code"
- Previous message: mikeb: "Re: ASP eating Javascript from VB code"
- In reply to: Martin: ".accept = "image/*""
- Next in thread: Martin: "Re: .accept = "image/*""
- Reply: Martin: "Re: .accept = "image/*""
- Messages sorted by: [ date ] [ thread ]
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
- Next message: Lloyd Sheen: "Re: ASP eating Javascript from VB code"
- Previous message: mikeb: "Re: ASP eating Javascript from VB code"
- In reply to: Martin: ".accept = "image/*""
- Next in thread: Martin: "Re: .accept = "image/*""
- Reply: Martin: "Re: .accept = "image/*""
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|