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

Leave a Reply

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

8 + 8 =


You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code class="" title="" data-url=""> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre class="" title="" data-url=""> <span class="" title="" data-url="">