An Image Upload Problem

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
gotornot
Forum Commoner
Posts: 54
Joined: Fri Jul 31, 2009 2:30 am

An Image Upload Problem

Post by gotornot »

Hi

I am looking to make an image uploader for my site. I have written the image upload file but its so basic im fearing it will be broken and if someone uploads an image with the same name it will just copy over someone elses.
I also need to check that its either jpeg or gif and maybe downsize the image so no one uploads a 5meg phot from a digital camera and crashes the site.
Does anyone have any ideas how to do the 3 things above?
klevis miho
Forum Contributor
Posts: 413
Joined: Wed Oct 29, 2008 2:59 pm
Location: Albania
Contact:

Re: An Image Upload Problem

Post by klevis miho »

For the first thing, give the image a name like username.jpg (if a user can upload just 1 photo).
If users can upload multiple photos, do something like username_microtime.jpg.
Post Reply