upoad all the files in a folder

Last post 06-24-2008 12:35 PM by James25. 5 replies.

Sort Posts:

  • upoad all the files in a folder

    06-16-2008, 4:54 PM
    • Member
      625 point Member
    • James25
    • Member since 07-29-2007, 9:54 PM
    • Posts 1,323

    Hi! Is there an example on how to upload all the files from a folder A to a folder A in the server. Thanks for any tips!

  • Re: upoad all the files in a folder

    06-16-2008, 5:21 PM
    Answer
    • All-Star
      28,218 point All-Star
    • johram
    • Member since 06-13-2006, 10:36 AM
    • Sweden
    • Posts 3,543
    • Moderator

    It is not possible to select multiple files in the default file selection dialog. So either you have to resort to an Active X component that allows multiple upload, a Flash upload component or you could use a pimped "default upload" construct with which you can upload multiple files in one go (although you have to select them individually).

    Example of Active X component: http://www.activexpowupload.com/

    Example of Flash component: http://www.element-it.com/MultiPowUpload.aspx

    Example of DHTML component: http://the-stickman.com/web-development/javascript/upload-multiple-files-with-a-single-file-element/

    If this post was useful to you, please mark it as answer. Thank you!
  • Re: upoad all the files in a folder

    06-16-2008, 5:27 PM
    Answer
    • Contributor
      5,367 point Contributor
    • AceCorban
    • Member since 08-23-2007, 3:43 PM
    • Monterey, CA
    • Posts 1,046

    I couldn't find any way to support uploading an unknown (at runtime) number of files to a server.  You could build controls to add an upload control on a user's action, but that isn't very intuitive for a user and can be a pain if there are more than a couple files.  I had to resort to uploading a zip file and unzipping it on the server.  It works ok.  I used a 3rd party zip utility to handle zipping/unzipping:

    http://www.icsharpcode.net/OpenSource/SharpZipLib/Default.aspx

    I never lose, some people are just better than me at winning.
  • Re: upoad all the files in a folder

    06-16-2008, 5:34 PM
    • Member
      625 point Member
    • James25
    • Member since 07-29-2007, 9:54 PM
    • Posts 1,323

    Hi! Is there a way to have a routine list folders in a directory then select a folder and upload all files in that folder at one time? I looked at the examples in the link, but in my case I have a folder that has 100 pictures and It'll take a long time if I want to upload one file at a time. Thanks!

  • Re: upoad all the files in a folder

    06-16-2008, 5:55 PM
    • Contributor
      5,367 point Contributor
    • AceCorban
    • Member since 08-23-2007, 3:43 PM
    • Monterey, CA
    • Posts 1,046

    I'd be curious to examine the activeX component a little more, but there are no controls that will grab all subfiles on a selected folder.  You can't really implement one in javascript because it doesn't have access to grab too much information from the user's computer and even if activeX did, your user would have to install it and enable it each time they wanted to use it.  I actually liked that guy's dhtml example, but as you mentioned, that is rather annoying when having to select 100 photos.  The flash part was pretty slick, but that will require you to be able to implement the flash piece, and it can be tricky to interoperate flash with server actions if you don't know what you are doing.  It was because of these reasons that I stuck with using zip files.  This, of course, carries its own set of cons, but it was the best solution for my needs.

    I never lose, some people are just better than me at winning.
  • Re: upoad all the files in a folder

    06-24-2008, 12:35 PM
    • Member
      625 point Member
    • James25
    • Member since 07-29-2007, 9:54 PM
    • Posts 1,323

    Hi! It can be done using silverlight and webservices though as I have heard but I didnt see any code samples.

Page 1 of 1 (6 items)