Dumb Newb Question - File Attachments

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts
  • jimriley
    Indigo Rose Customer
    • Feb 2003
    • 27

    Dumb Newb Question - File Attachments

    I thought this would be easy - but my brain has stuck

    What is the best way to distribute a zip file as part of an AMS application? I'd like users to be able to click on an image object which prompts them to save a zip file (which is stored in the project folder) to a directory of their choice.

    Thanks

    Jim

    tutor2u is a leading support service for A-Level, GCSE, and Vocational students and teachers
    ----------------------------------
    www.tutor2u.net
    UK Online Learning Resource of the Year
  • longedge
    Indigo Rose Customer
    • Aug 2003
    • 2496

    #2
    Jim,

    Do you mean that you want to extract the contents of a zip file to the users HD or just save an existing zip file to the HD for them to open later on?

    Either Zip.Extract or File.Copy.

    You can get the location by using Dialogue.FolderBrowse and then build it into a variable to use in the Zip.Extract/File.Copy action.
    Last edited by longedge; 06-04-2005, 11:29 AM.

    Comment

    • jimriley
      Indigo Rose Customer
      • Feb 2003
      • 27

      #3
      Not sure I'm doing this quite right:

      My code is


      destination = Dialog.FolderBrowse("Please select a folder where you would like to save your files:", "AutoPlay\\Docs");

      Zip.Extract("AutoPlay\\Docs\\MyZip.zip", {"*.*"}, "destination", true, true, "", ZIP_OVERWRITE_NEVER, nil);

      Can anyone tell me what I'm doing wrong/missing?

      Thanks

      Jim
      ----------------------------------
      www.tutor2u.net
      UK Online Learning Resource of the Year

      Comment

      • longedge
        Indigo Rose Customer
        • Aug 2003
        • 2496

        #4
        A quick guess without trying it Jim try -

        Zip.Extract("AutoPlay\\Docs\\MyZip.zip", {"*.*"}, destination, true, true, "", ZIP_OVERWRITE_NEVER, nil);

        destination is a variable and not a string.

        Comment

        • Corey
          Indigo Rose Staff Alumni
          • Aug 2002
          • 9741

          #5
          Hi, this one's kind of cool because it only requires a single line of code. Here's a working example attached. Hope that helps.
          Attached Files

          Comment

          • longedge
            Indigo Rose Customer
            • Aug 2003
            • 2496

            #6
            Economy is good - and that's economic :yes

            (Should come with a health warning though - aaaahhhh I just fell off my chair with vertigo. )

            Comment

            • Corey
              Indigo Rose Staff Alumni
              • Aug 2002
              • 9741

              #7
              Hee. Vertigo rules. :yes

              Comment

              • jimriley
                Indigo Rose Customer
                • Feb 2003
                • 27

                #8
                Fantastic - many thanks everyone!

                Jim
                ----------------------------------
                www.tutor2u.net
                UK Online Learning Resource of the Year

                Comment

                Working...
                X