PDA

View Full Version : Dumb Newb Question - File Attachments


jimriley
06-04-2005, 11:48 AM
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

www.tutor2u.net

longedge
06-04-2005, 12:16 PM
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.

jimriley
06-04-2005, 02:22 PM
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

longedge
06-04-2005, 02:31 PM
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.

Corey
06-04-2005, 03:35 PM
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. :)

longedge
06-04-2005, 03:54 PM
Economy is good - and that's economic :D :yes

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

Corey
06-04-2005, 03:59 PM
Hee. Vertigo rules. :yes

jimriley
06-04-2005, 04:30 PM
Fantastic - many thanks everyone!

Jim