i am asking users to upload images. i have been able to get the images uploaded and copied to the specified directory. i am also able to check the file size to make sure the images are not stealing too much disk. i do however have a couple of issues that i am unable to solve.
- how can i make sure that the files being uploaded are images (jpg or jpeg specifically) and not anything else?
i am uploading the file like this:
<INPUT NAME=\"image1\" TYPE=\"file\" ID=image1>
and then i am checking on $image1_type, but it keeps returning "file" regardless of what i upload. can some please show some working example code on how file checking works? what is the risk i run of allowing users to upload non-image files? can i just check the file extension and only allow users to upload .jp*g files?
- how can i resize images to conform to the size of my page? are there any functions that are available w/ a standard install of php3?
any help w/ either of these questions would be greatly appreciated. if you know of any links to sites dealing w/ these questions, please post.
thanks alot.
Aaron