How do I unzip a file of size 40 gb in Azure blob store using C#












0














How do I unzip a file of size 40 GB in Azure blob store using C#? I tried using Sharpziplib and ionic.zip. But I run into errors




Bad state (invalid block type)




. Can anyone please help me out?



Below is my code



        var storageAccount1 = CloudStorageAccount.Parse(connectionString1);
var blobClient = storageAccount1.CreateCloudBlobClient();
CloudBlobContainer container = blobClient.GetContainerReference("testwwpoc");

if (share.Exists())
{
Console.WriteLine("Yes");
Console.WriteLine("Yes");
CloudFileDirectory rootDir = share.GetRootDirectoryReference();
var file = container.GetBlobReference("WAV_WW_5988.zip");

// Ensure that the file exists.
if (file.Exists())
{
using (ZipFile zipFile = ZipFile.Read(file.OpenRead()))
{

zipFile.CompressionLevel = Ionic.Zlib.CompressionLevel.Default;
//zipFile.UseZip64WhenSaving = Zip64Option.Always;
zipFile.Encryption = EncryptionAlgorithm.None;
//zipFile.BufferSize = 65536 * 19000;
zipFile.Password = "xyz";

Console.WriteLine(zipFile.Entries.Count);
//var entry = zipFile.Entries.First();
//CloudFileDirectory sampleDir = rootDir.GetDirectoryReference("WAV_WW_5988");

//foreach (var entry in zipFile.Entries)
for (var i = 1; i < zipFile.Count; i++)
{

var blob = container.GetBlockBlobReference("test/" + zipFile[i].FileName);//+ entry.FileName);
Console.WriteLine(zipFile[i].FileName);
Console.WriteLine(zipFile[i].UncompressedSize);


try
{
blob.UploadFromStream(zipFile[i].OpenReader());
}
catch(Exception ex)
{
Console.WriteLine(ex);
}

}
}









share|improve this question
























  • Could you explain a little bit more ? you have a file in blob storage and you d like to unzip it to blob storage also ?
    – Thomas
    Nov 14 '18 at 8:24










  • Thomas, I have a zip file which is encrypted of about 40 GB in blob store. I would like to unzip the file to blob store. I am using Sharpziplib and Dontnetzip. But i run into errors like Bad state (invalid block type). Not sure how to resolve it.
    – Amogh Raghunath
    Nov 14 '18 at 14:43










  • Have you tried with a smaller file ?
    – Thomas
    Nov 14 '18 at 20:13










  • It works fine with a smaller file.
    – Amogh Raghunath
    Nov 15 '18 at 13:21










  • How this file has been uploaded ? maybe you should split it in multiple zip ?
    – Thomas
    Nov 15 '18 at 19:53
















0














How do I unzip a file of size 40 GB in Azure blob store using C#? I tried using Sharpziplib and ionic.zip. But I run into errors




Bad state (invalid block type)




. Can anyone please help me out?



Below is my code



        var storageAccount1 = CloudStorageAccount.Parse(connectionString1);
var blobClient = storageAccount1.CreateCloudBlobClient();
CloudBlobContainer container = blobClient.GetContainerReference("testwwpoc");

if (share.Exists())
{
Console.WriteLine("Yes");
Console.WriteLine("Yes");
CloudFileDirectory rootDir = share.GetRootDirectoryReference();
var file = container.GetBlobReference("WAV_WW_5988.zip");

// Ensure that the file exists.
if (file.Exists())
{
using (ZipFile zipFile = ZipFile.Read(file.OpenRead()))
{

zipFile.CompressionLevel = Ionic.Zlib.CompressionLevel.Default;
//zipFile.UseZip64WhenSaving = Zip64Option.Always;
zipFile.Encryption = EncryptionAlgorithm.None;
//zipFile.BufferSize = 65536 * 19000;
zipFile.Password = "xyz";

Console.WriteLine(zipFile.Entries.Count);
//var entry = zipFile.Entries.First();
//CloudFileDirectory sampleDir = rootDir.GetDirectoryReference("WAV_WW_5988");

//foreach (var entry in zipFile.Entries)
for (var i = 1; i < zipFile.Count; i++)
{

var blob = container.GetBlockBlobReference("test/" + zipFile[i].FileName);//+ entry.FileName);
Console.WriteLine(zipFile[i].FileName);
Console.WriteLine(zipFile[i].UncompressedSize);


try
{
blob.UploadFromStream(zipFile[i].OpenReader());
}
catch(Exception ex)
{
Console.WriteLine(ex);
}

}
}









share|improve this question
























  • Could you explain a little bit more ? you have a file in blob storage and you d like to unzip it to blob storage also ?
    – Thomas
    Nov 14 '18 at 8:24










  • Thomas, I have a zip file which is encrypted of about 40 GB in blob store. I would like to unzip the file to blob store. I am using Sharpziplib and Dontnetzip. But i run into errors like Bad state (invalid block type). Not sure how to resolve it.
    – Amogh Raghunath
    Nov 14 '18 at 14:43










  • Have you tried with a smaller file ?
    – Thomas
    Nov 14 '18 at 20:13










  • It works fine with a smaller file.
    – Amogh Raghunath
    Nov 15 '18 at 13:21










  • How this file has been uploaded ? maybe you should split it in multiple zip ?
    – Thomas
    Nov 15 '18 at 19:53














0












0








0


1





How do I unzip a file of size 40 GB in Azure blob store using C#? I tried using Sharpziplib and ionic.zip. But I run into errors




Bad state (invalid block type)




. Can anyone please help me out?



Below is my code



        var storageAccount1 = CloudStorageAccount.Parse(connectionString1);
var blobClient = storageAccount1.CreateCloudBlobClient();
CloudBlobContainer container = blobClient.GetContainerReference("testwwpoc");

if (share.Exists())
{
Console.WriteLine("Yes");
Console.WriteLine("Yes");
CloudFileDirectory rootDir = share.GetRootDirectoryReference();
var file = container.GetBlobReference("WAV_WW_5988.zip");

// Ensure that the file exists.
if (file.Exists())
{
using (ZipFile zipFile = ZipFile.Read(file.OpenRead()))
{

zipFile.CompressionLevel = Ionic.Zlib.CompressionLevel.Default;
//zipFile.UseZip64WhenSaving = Zip64Option.Always;
zipFile.Encryption = EncryptionAlgorithm.None;
//zipFile.BufferSize = 65536 * 19000;
zipFile.Password = "xyz";

Console.WriteLine(zipFile.Entries.Count);
//var entry = zipFile.Entries.First();
//CloudFileDirectory sampleDir = rootDir.GetDirectoryReference("WAV_WW_5988");

//foreach (var entry in zipFile.Entries)
for (var i = 1; i < zipFile.Count; i++)
{

var blob = container.GetBlockBlobReference("test/" + zipFile[i].FileName);//+ entry.FileName);
Console.WriteLine(zipFile[i].FileName);
Console.WriteLine(zipFile[i].UncompressedSize);


try
{
blob.UploadFromStream(zipFile[i].OpenReader());
}
catch(Exception ex)
{
Console.WriteLine(ex);
}

}
}









share|improve this question















How do I unzip a file of size 40 GB in Azure blob store using C#? I tried using Sharpziplib and ionic.zip. But I run into errors




Bad state (invalid block type)




. Can anyone please help me out?



Below is my code



        var storageAccount1 = CloudStorageAccount.Parse(connectionString1);
var blobClient = storageAccount1.CreateCloudBlobClient();
CloudBlobContainer container = blobClient.GetContainerReference("testwwpoc");

if (share.Exists())
{
Console.WriteLine("Yes");
Console.WriteLine("Yes");
CloudFileDirectory rootDir = share.GetRootDirectoryReference();
var file = container.GetBlobReference("WAV_WW_5988.zip");

// Ensure that the file exists.
if (file.Exists())
{
using (ZipFile zipFile = ZipFile.Read(file.OpenRead()))
{

zipFile.CompressionLevel = Ionic.Zlib.CompressionLevel.Default;
//zipFile.UseZip64WhenSaving = Zip64Option.Always;
zipFile.Encryption = EncryptionAlgorithm.None;
//zipFile.BufferSize = 65536 * 19000;
zipFile.Password = "xyz";

Console.WriteLine(zipFile.Entries.Count);
//var entry = zipFile.Entries.First();
//CloudFileDirectory sampleDir = rootDir.GetDirectoryReference("WAV_WW_5988");

//foreach (var entry in zipFile.Entries)
for (var i = 1; i < zipFile.Count; i++)
{

var blob = container.GetBlockBlobReference("test/" + zipFile[i].FileName);//+ entry.FileName);
Console.WriteLine(zipFile[i].FileName);
Console.WriteLine(zipFile[i].UncompressedSize);


try
{
blob.UploadFromStream(zipFile[i].OpenReader());
}
catch(Exception ex)
{
Console.WriteLine(ex);
}

}
}






c# azure unzip azure-blob-storage






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Nov 13 '18 at 3:19









Jayendran

3,20631336




3,20631336










asked Nov 12 '18 at 21:29









Amogh Raghunath

1




1












  • Could you explain a little bit more ? you have a file in blob storage and you d like to unzip it to blob storage also ?
    – Thomas
    Nov 14 '18 at 8:24










  • Thomas, I have a zip file which is encrypted of about 40 GB in blob store. I would like to unzip the file to blob store. I am using Sharpziplib and Dontnetzip. But i run into errors like Bad state (invalid block type). Not sure how to resolve it.
    – Amogh Raghunath
    Nov 14 '18 at 14:43










  • Have you tried with a smaller file ?
    – Thomas
    Nov 14 '18 at 20:13










  • It works fine with a smaller file.
    – Amogh Raghunath
    Nov 15 '18 at 13:21










  • How this file has been uploaded ? maybe you should split it in multiple zip ?
    – Thomas
    Nov 15 '18 at 19:53


















  • Could you explain a little bit more ? you have a file in blob storage and you d like to unzip it to blob storage also ?
    – Thomas
    Nov 14 '18 at 8:24










  • Thomas, I have a zip file which is encrypted of about 40 GB in blob store. I would like to unzip the file to blob store. I am using Sharpziplib and Dontnetzip. But i run into errors like Bad state (invalid block type). Not sure how to resolve it.
    – Amogh Raghunath
    Nov 14 '18 at 14:43










  • Have you tried with a smaller file ?
    – Thomas
    Nov 14 '18 at 20:13










  • It works fine with a smaller file.
    – Amogh Raghunath
    Nov 15 '18 at 13:21










  • How this file has been uploaded ? maybe you should split it in multiple zip ?
    – Thomas
    Nov 15 '18 at 19:53
















Could you explain a little bit more ? you have a file in blob storage and you d like to unzip it to blob storage also ?
– Thomas
Nov 14 '18 at 8:24




Could you explain a little bit more ? you have a file in blob storage and you d like to unzip it to blob storage also ?
– Thomas
Nov 14 '18 at 8:24












Thomas, I have a zip file which is encrypted of about 40 GB in blob store. I would like to unzip the file to blob store. I am using Sharpziplib and Dontnetzip. But i run into errors like Bad state (invalid block type). Not sure how to resolve it.
– Amogh Raghunath
Nov 14 '18 at 14:43




Thomas, I have a zip file which is encrypted of about 40 GB in blob store. I would like to unzip the file to blob store. I am using Sharpziplib and Dontnetzip. But i run into errors like Bad state (invalid block type). Not sure how to resolve it.
– Amogh Raghunath
Nov 14 '18 at 14:43












Have you tried with a smaller file ?
– Thomas
Nov 14 '18 at 20:13




Have you tried with a smaller file ?
– Thomas
Nov 14 '18 at 20:13












It works fine with a smaller file.
– Amogh Raghunath
Nov 15 '18 at 13:21




It works fine with a smaller file.
– Amogh Raghunath
Nov 15 '18 at 13:21












How this file has been uploaded ? maybe you should split it in multiple zip ?
– Thomas
Nov 15 '18 at 19:53




How this file has been uploaded ? maybe you should split it in multiple zip ?
– Thomas
Nov 15 '18 at 19:53












0






active

oldest

votes











Your Answer






StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");

StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53270372%2fhow-do-i-unzip-a-file-of-size-40-gb-in-azure-blob-store-using-c-sharp%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown

























0






active

oldest

votes








0






active

oldest

votes









active

oldest

votes






active

oldest

votes
















draft saved

draft discarded




















































Thanks for contributing an answer to Stack Overflow!


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.





Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


Please pay close attention to the following guidance:


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53270372%2fhow-do-i-unzip-a-file-of-size-40-gb-in-azure-blob-store-using-c-sharp%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

Bressuire

Vorschmack

Quarantine