I am trying to store images in a folder on server.
For some reason the images that need to be uploaded should be with their orignal name as uploaded by user i.e they can be changed only wth the original name in it.
1)So how can i put it in folder using php and retrieve it wherever needed whch means the name should be in database.
2)Now in the folder if two files with the same name are uploaded then the latest would overwrite whch should be avoided.
Plz could anyone give some way to make ths up.
1 reply to this topic
#1
Posted 12 February 2013 - 02:10 AM
#2
Posted 12 February 2013 - 08:07 AM
Your questions are not very clear, but here's my best guess at answers
Yes, you'd store the name of the file in your database somewhere so that you know which file to grab when you need it.1)So how can i put it in folder using php and retrieve it wherever needed whch means the name should be in database.
To avoid the overwrite you need to either use separate directories, or alter the name of the file in some way. For example, add the user's ID# as a prefix so if they upload photo.png you'd rename it on save to 1479_photo.png.2)Now in the folder if two files with the same name are uploaded then the latest would overwrite whch should be avoided.
Recycle your old CD's, don't trash them!
Did I help you out? Feeling generous? I accept tips via Paypal or Bitcoin @ 14mDxaob8Jgdg52scDbvf3uaeR61tB2yC7
Did I help you out? Feeling generous? I accept tips via Paypal or Bitcoin @ 14mDxaob8Jgdg52scDbvf3uaeR61tB2yC7
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users












