How can I rename image before uploading?
Posted: Wed Jun 06, 2007 12:39 am
Hello,
How can I rename image before uploading. I first insert image path/name into DB and then image into a directory on server. Now, if two user comes on my site and one is male and other is female and they both uploaded their display pictures. First male uploads with the name male.jpg and then female uploads with the same name then it overwrites the image and users don't see their actual picture. I don't want to create new folder for each user. I just want to first get ID of image I just inserted into DB as its auto-incremental and then concate that id with the image name and then upload. e.g. image_1.jpg, image_2.jpg and so on.
Thank you so much
Aamir
How can I rename image before uploading. I first insert image path/name into DB and then image into a directory on server. Now, if two user comes on my site and one is male and other is female and they both uploaded their display pictures. First male uploads with the name male.jpg and then female uploads with the same name then it overwrites the image and users don't see their actual picture. I don't want to create new folder for each user. I just want to first get ID of image I just inserted into DB as its auto-incremental and then concate that id with the image name and then upload. e.g. image_1.jpg, image_2.jpg and so on.
Thank you so much
Aamir