|
Posted by Jonathan N. Little on February 21, 2008, 7:36 pm
Please log in for more thread options GTalbot wrote:
>
>> how can I limit the file type to be only jpg and gif extension,
>> when the browse window open ?
>
> accept = content-type-list [CI]
> This attribute specifies a comma-separated list of content types
> that a server processing this form will handle correctly. User agents
> may use this information to filter out non-conforming files when
^^^^
The operative word is "may" and *none* of the browsers I have FF,
SeaMonkey, Opera, IE and old Netscape do.
> prompting a user to select files to be sent to the server (cf. the
> INPUT element when type="file").
> http://www.w3.org/TR/html4/interact/forms.html#adef-accept
>
> So:
>
> <input type="file" accept="image/jpg, image/gif">
>
> Not tested.
The only way check at the receiving server side script. You can use the
option of additionally prescreening the selection with JavaScript.
--
Take care,
Jonathan
-------------------
LITTLE WORKS STUDIO
http://www.LittleWorksStudio.com
|