I'd like to make an image gallery that can upload multiple images from the user and store them in the user folder. Each image must have a unique name. How do I set up so each image gets a unique file name? Are there any advanced uploading forms available similar to ones used on facebook or myspace to upload multiple images? Thanks for your help!
When I have written code like you describe, I rename the file to include a timestamp and the position in the upload to make it unique. ie somefile.jpg would be renamed to 'somefile_position_' . time() . '.jpg'; the result would look something like somefile_1_324347239.jpg If multiple files were uploaded, they would then look something like this: somefile_1_324347239.jpg somefile_2_324347245.jpg somefile_3_324347285.jpg
When ever you upload a image .we split the file name and extension and then concatenate the time stamp in between the file or extension.just like $fil="image.jpg"; $f=explode('.',$fil); $newfile=$f[0].time().$f[1]; echo $newfile; i think this will help you ..