0

I have seen in many applications where user is restricted to choose particular option only when user is trying to upload something..!!

For example if user is uploading image..he only see 2 options JPG and GIF format in file type option of Browser Window..!!

How can i do the same thing..!!

Waiting for Positive reply..!! :)

3
Contributors
2
Replies
3
Views
7 Years
Discussion Span
Last Post by edwinhermann
0

Due to the way the HTML file selector works it is not possible to do this through only HTML/PHP
However...
It is possible through Flash
There is a brilliant up-loader here - http://swfupload.org/
It allows you to specify file type as well as showing a progress bar

0

There is a way to specify this in HTML, but not all browsers adhere to it. Use the attribute accept in the <form> tag. Assign it comma-separated MIME types. For example:

<form accept="image/gif,image/jpeg" enctype="multipart/form-data" action="upload.php" method="post">

See http://www.w3.org/TR/html401/interact/forms.html#h-17.3 for more information.

Edited by edwinhermann: n/a

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.