Re: File upload
| From: | Bogdan Stancescu | Date: | Mon, 21 Jan 2002 17:51:23 +0000 |
| Subject: | Re: File upload | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-81402@lists.php.net to get a copy of this message | ||
The official way to do this would be using the "accept" attribute:
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 prompting a user to
select files to be sent to the server (cf. the INPUT element when
type="file").
For example,
<INPUT TYPE=\"FILE\" NAME=\"UPLOAD_FOTO\" SIZE=\"40\"
ACCEPT=\"image/jpeg\">
Unfortunately this is usually unreliably implemented in user agents, so you
should find a different solution as suggested by others.
Bogdan
Danielle van Gladbach wrote:
> How can I, using:
> <INPUT TYPE=\"FILE\" NAME=\"UPLOAD_FOTO\" SIZE=\"40\">
> specify the file extension.
> I want the user only to upload *.jpg.
>
> Thanks,
> Danielle
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
> For additional commands, e-mail: php-general-help@lists.php.net
> To contact the list administrators, e-mail: php-list-admin@lists.php.net