PHP Rename image while image uploading

Change image name while image uploading

In php we use file upload for uploading text file, image file and any document to our web application.
Some time we upload upload different image but the image name same at that time the old image replaced by last uploaded image.

Mostly in all social networking site all user upload their profile picture in account, what happens if some user upload same name image for profile picture. The last image displayed in both user profile picture, previous user profile picture replaced by new user profile picture.

To prevent above situation we need to rename the picture name while uploading, use some unique image name combination of unique userid with text..etc..

Rename Image name PHP Example

The php example output is :

PHP file upload example
Rename image name while image upload
(Visited 193 times, 1 visits today)

Leave a Reply

Your email address will not be published. Required fields are marked *

Captcha *