0

Directories in file zipper?

I'm trying to use the file zipper example to copy a directory that has a sub-directory under it. All of the files are being included, but the directory structure is lost. According to the sample code on http://browserplus.yahoo.com/developer/web/code/zipper/,
--------------------------------------------------------
File Zipper is a demonstration of chaining BrowserPlus services together. Select multiple files using FileBrowse, zip them together with the Zipper Service, to create a single compressed archive that preserves the folder structure. The archive is then uploaded with the Uploader Service.
--------------------------------------------------------
Has anyone tried this example with the expected results?

I'm trying to create a drag-and-drop file upload with BrowserPlus. Unfortunately, trying to get the directory info from dropped files and using that info for creating directories on the server is apparently nearly impossible.
So I decided to go the zip route and just unzip the files on to the server with some server side code. But this doesn't seem like it's going to work either.

Anyone with any suggestions? Or links to any better examples? Or better documentation?

Thanks,
JoeC

by
4 Replies
  • If you want to include path information from the selection, you must set includeGestureInfo to true and then use actualSelection when creating the zip. This is documented at the very bottom of the File Zipper code demo:

    http://browserplus.yahoo.com/developer/web/code/zipper/

    For Drag and Drop, your code would look like this:

    BrowserPlus.DragAndDrop.AddDropTarget({id: "myid", includeGestureInfo: true, ... }, function(){});

    Hope that helps,

    Steve
    0
  • QUOTE (steven_spencer @ Mar 18 2009, 05:34 AM) <{POST_SNAPBACK}>
    If you want to include path information from the selection, you must set includeGestureInfo to true and then use actualSelection when creating the zip. This is documented at the very bottom of the File Zipper code demo:

    http://browserplus.yahoo.com/developer/web/code/zipper/

    For Drag and Drop, your code would look like this:

    BrowserPlus.DragAndDrop.AddDropTarget({id: "myid", includeGestureInfo: true, ... }, function(){});

    Hope that helps,

    Steve


    Steve, I realize this. I copied the sample provided by Yahoo, and it doesn't work.
    All of the files are zipped, but all of the directory information is lost.

    Joe C
    0
  • To clarify, I want to create a drag and drop app, but for testing I used the File Zipper sample provided to see if I could upload multiple folders at one time. The sample code has the required settings in it. As it says at the bottom on the sample code:
    ...note how includeGestureInfo is set to true on line 27 and actualSelection is used in the call to BrowserPlus.Zipper.createZip() on line 45.

    The only change is to the page that is called to actually upload the file.
    All of the files from the subfolders are added to the zip, but all of the directory information is lost.

    JoeC
    0
  • QUOTE (Joe C @ Mar 18 2009, 06:13 AM) <{POST_SNAPBACK}>
    To clarify, I want to create a drag and drop app, but for testing I used the File Zipper sample provided to see if I could upload multiple folders at one time. The sample code has the required settings in it. As it says at the bottom on the sample code:
    ...note how includeGestureInfo is set to true on line 27 and actualSelection is used in the call to BrowserPlus.Zipper.createZip() on line 45.

    The only change is to the page that is called to actually upload the file.
    All of the files from the subfolders are added to the zip, but all of the directory information is lost.

    JoeC


    Joe,

    The File Zipper demo does work for me. Looking at the uploaded zip file, I see multiple levels of sub directories. I tested this on both Windows and OS X.

    Note that in this simple example, if you "Select Files..." more than once before pressing "Upload File", the latest selection will replace the previous selection. This is a limitation in the example code, not in the Zipper code.

    Not quite sure what else it could be,

    Steve
    0
This forum is locked.

Recent Posts

in Support & General Questions