1

I have a folder on my desktop and i want to convert it into a .zip file. It shouldnt ask me were to save it but just save it straight to my desktop or any folder i specified.

I tried ASZip, fZip etc. but i can't get it to work. There isn't any of them that seem to let me just add a folder and zip it. I was only able to create a byteArray wit ASZip but when i saved it, it left me with a file that was not able to be opened.

Would it be possible to achieve what i want without the use of an external library? Any help would be appreciated.

4

1 回答 1

0

You can't actually zip a folder but you can zip all the contents inside the folder. You would have to use FileReferenceList to load in flash all the files inside the folder.

FileReferenceList allows you to have multiple selection in the browse window.

Then you would have to pass all these files to the zip managing library and get a ByteArray from it.

This byte array you would localy dump inside a "yourFileName.zip" by using FileReference.save().

The application cannot save the file to a predetermined location. The user has to pick the location using the "save to" prompt.

于 2012-05-29T01:37:14.300 回答