Secure User Image Upload Capabilities in PHP

后端 未结 4 1394
[愿得一人]
[愿得一人] 2020-12-01 14:45

I\'m implementing a user-based image uploading tool for my website. The system should allow any users to upload JPEG and PNG files only. I\'m, of course, worried about se

4条回答
  •  伪装坚强ぢ
    2020-12-01 15:25

    Concerning No. 2, I read on php.net (documentation of the function getimagesize() ):

    Do not use getimagesize() to check that a given file is a valid image. Use a purpose-built solution such as the Fileinfo extension instead.

提交回复
热议问题