Hello!
I would like to know two things:
1) I am a little newbie to PHP (although I'm not a newbie to programming), and I am aware that File Upload is generally responsible for many security flaws. However, I do not know how can I make a secure file upload.
2) The files I want to be uploaded are images. How do I know that it is indeed an image?
I am thinking of programming a photolog, and therefore I need to give the users the possibility of uploading images and attaching each image to a "blog" post.
How can I code the file upload procedure? Can someone help me on this? I know nothing about this :x
And how can I confirm that the uploaded file is in fact an image, and not an executable of some kind? I do need to make sure that the user isn't attempting to upload malware so that (s)he can link to it later to their own misuse, and I can't just look at the file extension. I will rename the file (specially to avoid filename conflicts) to some pseudorandom stuff, but anyway, better safe than sorry.
Thanks for your time!
critical_error