On 12 Oct 2007, at 01:27, Ben Sgro ((ProjectSkyLine)) wrote:
I want to allow users to upload images (.png, .jpg, .jpeg, gif,
etc) to use
as an avatar for an online application.
What's the best 3rd party lib for doing this. It will need to
resize to approriate
sizes (maybe even convert to a common format)
http://pear.php.net/package/Image_Transform
or
http://pecl.php.net/package/imagick or use the GD Library - it's
really not that hard...
and I need it to be secure,
no "file.gif.php" or #> cat "<?php phpinfo(); ?>" > img.php hacks.
Check for the file's mimetype via:
http://pecl.php.net/package/Fileinfo (some docs on this: http://
www.jellyandcustard.com/2006/01/19/php-mime-types-and-fileinfo/ )
Or via the command line:
/usr/bin/file -i filename.ext (your location of the file program may
vary)
Khalid
_______________________________________________
New York PHP Community Talk Mailing List
http://lists.nyphp.org/mailman/listinfo/talk
NYPHPCon 2006 Presentations Online
http://www.nyphpcon.com
Show Your Participation in New York PHP
http://www.nyphp.org/show_participation.php