|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
|
|
SlickEdit: Code in over 40 languages across 7 platforms. SlickEdit’s unmatched power, speed, and flexibility allows even the most accomplished developers to write better code faster. Download a free trial today! |
|
#1
|
|||
|
|||
|
Multiple files upload using PHP
Iam a new bie....
I have to upload three files like one bye one...it's working fine but the problem is when iam uploding second time (i.e if i upload the same file i mean some other user will upload his file with the same name...the first uploaded file is overwriting..i don't want to happen this...) i want the two files in my database...what is the solution for this... experts can any one help me ..... Rgds, mahesh |
|
#2
|
|||
|
|||
|
I use to do this:
I change the name of the uploaded file when saving. The new name is generated using the upload database record ID, so it's unique. Example: File Name: manolo.xls Insert query: insert into uploaded (id,usr,name,dateuploaded) values (NULL, 213, 'manolo.xls', now()) Then I recall the last insert ID: $newname=mysql_insert_id().".file"; This will generate a new name like this: 158.file That's the file name you save. And when you want to deliver the file as a download, just retrieve the actual name from the DB. ;-) |
|
#3
|
|||
|
|||
|
Thank you for your reply...
|
|
#4
|
|||
|
|||
|
Take a look at my multiple php upload tutorial as well. I might help you out on the concepts of doing this.
http://www.devarticles.com/art/1/671
__________________
Nothing is Everything
|
![]() |
| Viewing: Dev Articles Community Forums > Programming > PHP Development > Multiple files upload using PHP |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|