I know this topic has been touched on a couple of times, but I'm still unclear of the exact answer (there's a topic fairly close but doesn't quite address it).
I have a constantly changing remote zip file that I want to download, then take the contents and unzip it using SharpZipLib (which I have working with a local file), and use the contents of the zip file. Is there a way to do this (or a library already available) either using the WWW lib, the WebClient lib, or even through some sort of php mechanism (but then would the unity web player have access to that file)? Or am I stuck with having to stream the content in and working with it that way?
Thanks in advance!
Well if you need to save it to disk and you're not using a web player, then you can just call System.IO.File.WriteAllBytes to write the bytes array to a file in one call.
– StatementIf your SharpZipLib support a stream to do the extracting you can just create a new MemoryStream.
– StatementCreate a new MemoryStream and set the contents to the bytes buffer, and follow this sample? http://wiki.sharpdevelop.net/SharpZipLib-Zip-Samples.ashx#Unpack_a_zip_using_ZipInputStream_eg_for_Unseekable_input_streams_5
– Statement^ Instead of loading with WebClient, just do as in the answer and let data be a MemoryStream. Create the stream as such var data = new MemoryStream(bytes);
– Statement"but still am hoping to find a solution that downloads the file locally when I'm using the unity webplayer" - you can't. Security policy.
– Statement