Re: Hi

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 6 September 2010 14:46, Jordan Jovanov <jovanovjoce@xxxxxxxxx> wrote:
> Hi All
>
> I need me a little help.
> I create scripte for upload file is work very good but the problem is next:
> I neet to upload only .zip file i need to disable some user to shoise to
> upload another file Extensions.
>
> Can somebody help me.
>
> Thanks a lot.
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

Using standard HTML ... no. There is nothing in the <input type="file>
element to instantly limit the file type. You can use JavaScript to
some degree (http://www.codestore.net/store.nsf/unid/DOMM-4Q8H9E for
example).

As far as PHP goes, one of the values returned to you is the
$_FILES['userfile']['type'] property.

If this matches the zip file mime type (application/x-zip but also
application/x-gzip and maybe multipart/x-gzip, multipart/x-zip), then
you have a better chance of knowing it is a zip file.
-- 
Richard Quadling
Twitter : EE : Zend
@RQuadling : e-e.com/M_248814.html : bit.ly/9O8vFY

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux