Pergunta

I currently have a web role which displays a webpage, the webpage allows the user to select a file from their computer, the web role then uploads the file to some Azure Blob Storage.

However the file the user usually uploads is a zip file so i would like to unzip the file and extract the contents and then upload the contents to the Azure Blob Storage.

I have attempted to do this by using the SharpZipLib example I found here

http://blog.logiclabz.com/c/unzip-files-in-net-c-using-sharpziplib-open-source-library.aspx

I have add the references to my web role for the ICSharpCode.SharpZipLib.dll file and the ZipOperations.dll however I am still receiving the following errors; enter image description here

Another thing I am confused about is when I am calling UnZipFile(...); what would be the directory of the file I am uploading, would it be the ID of the form which the file is selected in.

Thanks in advance, Sami.

Foi útil?

Solução

The ZIP file should be uploaded to your web role local disk first, let's say you saved it in a local resource. Then you can invoke the SharpZip to extract the content to some other local resource, then finally upload the content files to the BLOB.

Regarding the windows azure local resource, please have a look http://msdn.microsoft.com/en-us/library/windowsazure/ee758708.aspx

Regarding your errors it looks like you didn't add necessary "using" statements at the beginning of your code. For example you need "using System.IO" then you can use File, Directory, etc. in your code.

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top