SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Zealot
    Join Date
    Jul 2001
    Location
    Estonia
    Posts
    123
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Uploading multiple files into database

    I was wondering if it is possible to upload multiple files using one form. I can upload one file at the same time, but can't figure out how to upload more than one file.

  2. #2
    SitePoint Evangelist =X='s Avatar
    Join Date
    Jun 2001
    Posts
    487
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I'd recommend not to put files in the db, but if you still want to proceed with this:

    make the upload form (for eg 5 files) like this:
    PHP Code:
    for($num=1$num<6$num++)
    {
        print 
    "file $num:<input name=\"file$num\" type=\"file\"><br>\n";

    then just make a for loop with as many loops as there are files and loop trough the upload script!

    another method is by uploading a zip file that contains all the files and then unzipping it - but this isn't the best method if you want to put the files in the db
    PHP-Webservices - Profesional Hosting and Programming of sites.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •