274 questions
0
votes
0
answers
33
views
Save a PDF file and read contents from the saved file [duplicate]
I'm trying to save a PDF file uploaded from the file uploader control in to a temporary location and read content from the saved file, but I'm getting error "The process cannot access the file ...
0
votes
1
answer
117
views
Cannot set encoded comment for zip archive using sharpZipLib
I need the comment for the zip file to be properly encoded. In particular, I have Greek characters in comment. After creating the zip file, the characters become question marks. Here is the code I use:...
0
votes
0
answers
220
views
How to add an entry to an existing TAR-File using SharpZipLib
We are using SharpZipLib to create new TAR files with C# and this workes perfectly. Now we came to the situation where we had to add one more file to an existing TAR file. The size of the file ...
1
vote
0
answers
109
views
SharpZipLib make tar.gz with directory name prefixed to filenames
I'm using SharpZipLib to make a tar.gz archive, but I need to prefix a directory name to the filenames. That is, the files going into the archives look like foo.exe, but the archive needs to know them ...
0
votes
1
answer
409
views
Zip Azure Storage Files and Return File from Web API returns corrupted files when unzipped
Zip Azure Storage Files and Return File from Web API returns corrupted files when unzipped. Here is my code:
[HttpPost(nameof(DownloadFiles))]
public async Task<IActionResult> DownloadFiles(List&...
0
votes
2
answers
584
views
How to move directory in azure and ZIP it using ShareDirectoryClient in azure file share
I am able to move the directory in azure using ShareDirectoryClient successfully.
using System;
using System.Threading.Tasks;
using Azure.Storage.Files.Shares;
namespace SO69798149
{
class ...
1
vote
1
answer
351
views
TarArchive Hangs When Trying to Extract Contents
I'm trying to create a tar archive, then extract all the contents to a file using SharpZipLib. I am able to create the tar archive, but the program hangs when trying to extract it. I'm wondering if ...
1
vote
1
answer
293
views
How to extract more than 900,000 bytes using SharpZipLib BZip2
When using ICSharpCode.SharpZipLib to decompress BZip2 files I am having an issue where only the first 900,000 uncompressed bytes are extracted. I've tried both the BZip2InputStream and the BZip2....
0
votes
1
answer
231
views
AESKeySize parameter with ZipEntry doesn't seem to allow decompression/unzipping
The following code seems to mostly work fine. But as soon as I apply an encryption value (commented out code) to the ZipEntry, everything seems to fall apart. I get the following exception:
...
-2
votes
1
answer
61
views
app.exe is used by another process while extracting zip
When I try to extract my zip that I just downloaded from server I get System.IO.IOException Process cant access file "myappsolution".exe because it is used by another process.
WebClient ...
2
votes
0
answers
842
views
SharpZipLib does not unzip password protected zip-file
I use SharpZipLib to unzip files.
For this, I use this code:
using (var fsInput = File.OpenRead(zipFile))
using (var zf = new ZipFile(fsInput)) {
zf.Password = password;
...
0
votes
0
answers
1k
views
How to secure zip file with password using c# and SharpZipLib
I have to prepare zip file and secure it with password.
I'm using C# and SharpZipLib library.
I have to return the created file using WebApi. The code below does not work - I can open file without ...
1
vote
2
answers
279
views
Cannot extract the contents of a TGZ file using F# and SharpZipLib
I am learning F# and Deedle. I am trying to extract the contents of this TGZ File using SharpZipLib. I downloaded the TGZ to my local drive. I think I am close because out1 works, but out2 errs. I ...
0
votes
0
answers
778
views
Error GZIP header, first magic byte doesn’t match - How to Decompressing .tar.gz file using SharpZipLib
I’m trying to decompress a compress file with multiple files on it
the following code works to .tgz files, but don’t for .tar.gz files
What is wrong here?
FileInfo infoCompressed = new FileInfo(...
0
votes
1
answer
2k
views
Creating a zip archive from memory stream in .Net Core
I'm trying to create a zip archive from memory stream and when I download it from my API on the web-side it tells me the archive is corrupt when I try to open it (and not much else, the download ...
2
votes
0
answers
722
views
SharpZipLib : How Compress a single file to a single zip file with FastZip
I found this method for compressing a single file to a single zip file using SharpZipLib.
private static void CompressFile(string inputPath, string outputPath)
{
FileInfo outFileInfo = new ...
1
vote
0
answers
148
views
Encoding method used for the SSO saml request/data in the our application got depreciated
We are using UTF8 encoding method to encode the SSO saml request/data in the our application and it was working fine. But suddenly the SSO functionality stopped working and on analysis we found that ...
-2
votes
1
answer
521
views
How to Zip Excel file using CLOSEDXML and Sharpziplib C#
i am new C# Beginner,
I created a function to generate Excel using ClosedXML.Excel, but i also want to zip the excel fill, how to zip excel file using Sharpziplib? anybody could give an adivse?thanks
...
0
votes
0
answers
552
views
How to limit the size of generated ZIPs?
I'm using :
ICSharpCode.SharpZipLib.Zip.FastZip z = new ICSharpCode.SharpZipLib.Zip.FastZip();
So i'm generating a zip regarding a folder. This folder contains several files.
z.CreateEmptyDirectories ...
0
votes
1
answer
925
views
When should I call Finish on the ZipOutputStream (SharpZipLib)
SharpZipLib is a .Net implementation for Java library for working with archives. It provides ZipOutputStream class, which derives from DeflaterOutputStream and has Finish() method. In the docs here it ...
-1
votes
1
answer
2k
views
Why am I getting GZip compression size of a string more than the original size after compression when using SharpZipLib in C#
My string is a Json file (test.json) with the below content
{
"objectId": "bbad4cc8-bce8-438e-8683-3e603d746dee",
"timestamp": "2021-04-28T14:02:42.247Z",
...
0
votes
1
answer
2k
views
How to read data from inner archives without extracting zip file?
I have a zip file which contains inner zip file (Ex:ZipFile1.zip->ZipFile2.zip->file.txt). I want to read the data of inner archive file content (file.txt) using ICSharpCode.SharpZipLib library ...
3
votes
1
answer
1k
views
No Encoding for Name field is specified, any non-ASCII bytes will be discarded
The following .NET 5.0 code using ICSharpCode.SharpZipLib
var gzipInputStream = new GZipInputStream(sourceStream);
var tarInputStream = new TarInputStream(gzipInputStream);
var gZipOutputStream = new ...
0
votes
2
answers
620
views
Decompressing zlib compressed data using SharpZipLib
I am looking at the following line of c++ code, where "zlib.h" is included
int err = compress2(compressed.get(), &dest_len,
reinterpret_cast<const unsigned ...
-2
votes
1
answer
878
views
How to generate TAR Zip(.tar.gz) of multiple CSV Azure Blob Storage V2 and Output the result file in Blob using SharpZipLib library
I need to TarZip(.tar.gz) multiple CSV files that are present in Azure blob storageV2 inside container named input and save resultant file in another container output using SharpZipLib library in C# ...
-1
votes
2
answers
901
views
TriLib SharpZipLib.Zip.ZipEntry - Cannot access a closed Stream for GetInputStream()
(This is using Unity 2020.1.4f1 with Trilib 2.0.9 Model Loader)
I'm trying to extract the bytes from a zipStream (to load the bytes[] into a Texture2D.LoadImage() in Unity). How do you do this?
Here's ...
-4
votes
1
answer
9k
views
How do you write a ZipFile to disk using SharpZipLib [closed]
How do you write a ZipFile to disk using SharpZipLib?
Do you have to open an output stream to write a ZipFile to disk?
Is there some way to just get the ZipFile bytes and do File.WriteAllBytes()?
...
0
votes
1
answer
249
views
C# Unzip a textfile (.GetInputStream()) from an archive to string using SharpZipLib
How do you unzip a textfile from a zip archive to string?
Does the textfile also need MemoryStream or StreamReader like the image binary?
Specifically:
foreach (ZipEntry e in zipFile)
{...
0
votes
0
answers
1k
views
SharpZipLib issues with WinZip version file
Hi i'm triying to uncompress a zip file with the library SharpZipLib v1.2.0 but i can't make it works.
The file that i try to uncompress was made with WinZip 9.0 and have password protection
I use ...
0
votes
0
answers
2k
views
SharpZipLib compression level between creating or updating a zip file
I've got a couple of questions regarding the use of ShareZipLib.
I'm using 2 different methods to create a zip file and updating one which seems like overkill. Is there a better way?
Create Zip File:...
0
votes
1
answer
159
views
Decompress stream from HttpClient using SharpZipLib in Xamarin.Forms
I am trying decompress stream from HttpClient using SharpZipLib in Xamarin.Forms. This code perfectly works on iOS, but on Android CanDecompressEntry() always returns false. What i'm missing? Maybe ...
0
votes
1
answer
1k
views
How to compress file data with ICSharpCode.SharpZipLib and upload using HttpClient?
I'm using ICSharpCode.SharpZipLib and doing the following: reading a file content, compressing (zlib) and then uploading to a server using HttpClient.PostAsync
My regular approach (as works for ...
0
votes
1
answer
509
views
.Net : Unzipping Gz file : Insufficient memory to continue the execution of the program
So I have been using the method below to unzip .gz files and its been working really well.
It uses SharpZip.
Now I am using larger files and it seems to be trying to unzip everything in memory ...
2
votes
0
answers
2k
views
"EOF in header" => POI
Iam trying to pass in a MemoryStream(not a Filestream).
This is what I did:
XWPFDocument w2 = new XWPFDocument(memoryStream);
This is what I get:
EOF in header
Updated my post:
...
0
votes
1
answer
2k
views
sharpziplib FastZip extract rar error cannot find central directory c#
i want to extract RAR file using FastZip, here is my code :
FastZip fastZip = new FastZip();
fastZip.CreateEmptyDirectories = true;
if (password != "")
{...
2
votes
1
answer
141
views
Can I copy a compressed file from one Zip file to another without decompressing and recompressing it?
I am currently using SharpZipLib for reading/writing ZIP files in C#. Often I want to create a new ZIP file, containing some of the files from an old ZIP file. How can I copy entries between ZIP ...
3
votes
0
answers
195
views
System.OutOfMemoryException when tried with 70 files SharpZipLib
I have tried zipping 70 pdf documents but ended up having a System.OutOfMemoryException.
Please look into the following code and let me know whats wrong with it.
Please note that I have posted issue ...
2
votes
1
answer
6k
views
C# SharpZipLib for .NET Core
We have version 0.86 of ICSharpCode.SharpZipLib.dll and it is not .NET Core compatible.
There appears to be two main (and several more) "latest" version of it. SharpZipLib and SharpZipLib.NETStandard,...
0
votes
0
answers
228
views
How write memorystream into ZipFile
I have a zip file. I want open it with SharpZipLib and add a new ZipEntry to it that it is created in memory.
I am new to SharpZipLib. I googled very much but couldn't find similar problem.
My Sample ...
2
votes
1
answer
4k
views
Extract tgz file in memory and access files in C#
I have a service that downloads a *.tgz file from a remote endpoint. I use SharpZipLib to extract and write the content of that compressed archive to disk. But now I want to prevent writing the files ...
2
votes
1
answer
1k
views
Extracting AES encrypted zip to MemoryStream
I am developing a process to compress and encrypt a byte array in my desktop application and send it via a WebMethod to my web application, then uncompress/unencrypt it back to a byte array. I am ...
1
vote
1
answer
1k
views
Zip Azure Storage Files and Return File from Web Api
I am trying to create a zip file with SharpZipLib from files stored on Azure Storage. Unfortunately I am not able to return them because the Api always returns a Json:
{"Version":{"Major":1,"Minor":1,...
3
votes
0
answers
2k
views
c# zip multiple files and download - can't open file in windows explorer
I use the SharpZipLib for zipping multiple files and download them in my asp.net c# web app. After the download I can't open the zip archive. Windows error message is:
Windows cannot open the ...
1
vote
1
answer
323
views
When to close file stream
I reading a file in a zip file using streams like this :
public static Stream ReadFile(Models.Document document, string path, string password, string fileName)
{
FileStream fsIn = ...
-1
votes
1
answer
75
views
Determine file or directory from string
I'm trying to extract some files from a Zip file, but the FastZip.ExtractZip method I was using is having some issues, for example:
Output location: C:\testing\output\
File 1: PhysicalMemory/idx - ...
0
votes
1
answer
7k
views
.net core unzip a file and zip subfolder
I have a byte[] of a zip file. I need to unzip the file in memory and find "dist" folder inside the zip (there will be always a dist folder) and create a new zip file with whatever inside that "dist" ...
0
votes
1
answer
715
views
How do I extract any archives with SharpZipLib?
I'm using SharpZipLib to extract archives. I managed to extract .zip archives:
FastZip fastZip = new FastZip();
fastZip.ExtractZip(file, directory, null);
and to extract .tar.gz:
// Use a 4K ...
1
vote
1
answer
4k
views
Found conflicts between different versions of "ICSharpCode.SharpZipLib" that could not be resolved
I am using NPOI in my MVC 5 project. When I installed it via Nuget, I have installed SharpLib 0.86 because it is a dependency.
After doing this, NPOI generates a 0 bytes file. When I build the ...
0
votes
0
answers
213
views
Why do I only get the first few lines of file when using GZipStream to decompress in dotnet core
I'm trying to read a series of gzip files using the code below.
What I end up with is a file that is only a fraction of the total file. Interestingly enough the text file output is almost perfectly ...
2
votes
1
answer
4k
views
Using SharpZipLib How do I set the encryption algorithm?
I am writing a zip file generator which will be consumed by a third party using a specific encryption algorithm
I have found the enumeration of algorithms here:
ICSharpCode.SharpZipLib.Zip....