x


Download ZIP file with WWWform unzip with SharpZipLib possible?

Hey guys and gals,

I'm developing an app for a client that will require custom .zip data files (i.e. images, video, audio, folder structure, etc) to be downloaded to the iPad from a webserver and then unzipped on the iPad to the documents folder to be accessed later with http://system.io. AssetBundles are not an option as the user will be creating these ZIP archives through na desktop application.

The unzipping works fine on local files (c:/whatever.zip) and I know who to use wwwform.

Question: can WWWform be used in this manner? My tests seem to say no. If not is there a .NET library available I should be using? Anyone now of a commercial plugin/solution for this?

Below is some pseudo code to illustrate:

var url : String = "http://www.somesite.com/test.zip";
var www = new WWW(url); 

        // wait until the download is done
    while(!www.isDone)
        //print(www.progress);  
        yield www; 



        if(www.isDone) {
        myZipFile =  www.bytes; 
        showButton = true;
        FolderZipper.ZipUtil.UnZipFiles("c:/_PTP/" + myZipFile,"C:/_PTP/","",false);

    }
more ▼

asked Sep 14 '10 at 03:03 PM

Julian Glenn gravatar image

Julian Glenn
2.6k 5 12 47

(comments are locked)
10|3000 characters needed characters left

1 answer: sort voted first

You're trying to use the downloaded bytes as the path for the string - you may need to make a helper function in ZipUtil which takes bytes instead of a path (which just gets the bytes from the hard drive anyway from what i saw when checking for that class)

more ▼

answered Sep 14 '10 at 03:36 PM

Mike 3 gravatar image

Mike 3
30.5k 10 65 252

@Mike - thanks will take a look. But can you tell me is this a standard way to do things. Is it OK to download ZIP files to an Apple iOS device an use them in Unity or is that a Mr. Jobs no-no offense?

Sep 14 '10 at 05:10 PM Julian Glenn

I can't see why not unless they contain code of some kind

Sep 14 '10 at 05:15 PM Mike 3

@Mike - coolbeans. Thanks for your time.

Sep 14 '10 at 05:32 PM Julian Glenn
(comments are locked)
10|3000 characters needed characters left
Your answer
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Topics:

x360
x65
x16
x1

asked: Sep 14 '10 at 03:03 PM

Seen: 2474 times

Last Updated: Sep 14 '10 at 03:03 PM