Safe image uploading with PHP

Posted by directedition on Stack Overflow See other posts from Stack Overflow or by directedition
Published on 2010-06-06T13:00:13Z Indexed on 2010/06/06 13:02 UTC
Read the original article Hit count: 313

Filed under:
|
|

I want my site to have a feature for users to upload images, but I want to do it safely. Namely, I want to strip the EXIF data and any malicious code that could be in their image. I was thinking of a way to do this involving direct manipulation of the file, but it struck me, would it make more sense to just convert the image they provide to BMP and then convert that back to the original format? It would suffer a generational loss, but I believe that would meet my project's requirements. BMP doesn't contain EXIF, does it? And the reprocessing should strip any malicious content.

© Stack Overflow or respective owner

Related posts about php

Related posts about exif