Quantcast
Channel: DotNetZip Library
Viewing all 664 articles
Browse latest View live

New Post: Error 57 when zip.save

$
0
0
Hi,
I have a problem which probably is very easy to solve, but I just don't find a solution.
In my application a user is importing .csv-files into a database. After the import the .csv-file is being zipped and afterwards deletes from the directory on the filesystem. That works perfectly well.
However, the user ought to get the possibility to unzip a specific file again. That works, too. But when I want to delete this file from the zip-archive and save this zip-archive, I always get the error 57, sayint that the process cannot access the file as another process is using it.
This is my code and any help is appreciated:

Public Shared Sub ExtractOneFile(strZip As String, strFile As String, strDestination As String)
'strZip = Ziparchive
'strFile = das zu entpackende .csv-File
'strDestination = Zielverzeichnis

Try
Using zip As ZipFile = ZipFile.Read(strZip)
Dim e As ZipEntry

For Each e In zip
If e.FileName = strFile Then
e.Extract(strDestination, ExtractExistingFileAction.OverwriteSilently)
zip.RemoveEntry(e)
zip.Save()
Exit For
End If
Next

End Using
Catch
MsgBox("Zip-Class; ExtractOneFile" & vbCrLf & Err.ToString)
End Try
End Sub

New Post: Ionic ZIP Memory/performance issue with Extract specified files from Large zip file in Web

$
0
0
0
down vote
favorite
I have a rest method to extract the specified html file from zip file (more than 100 MB). When i download that html, browser will call the same rest for relative files (referred in html) So for this case if zip file have 10 files then, for each file i am downloading ZipFile as byte array, convert it to stream and then convert that stream to ZipFIle. And then i am extracting the requested file So this occupying full memory.

I have tried with Web caching. But I am sure site will crash if multiple user call the rest method for different zip files at same time

please guide me on this.

Thanks in advance

Created Unassigned: UnauthorizedAccessException in ExtractAll stops extraction [17701]

$
0
0
Hello and due to some really impolite "Issues" some people seem to have (primarily and usually with themselves ;-) ) I first wish to thank the creator of this project.

Thank You.

Way better than the on-board C# API, sure, not perfect, but it's simple and works for me.

Now for the issue:
Whe using ExtractAll in conjunction with ExtractExistingFileAction.OverwriteSilently and one of the Entries is locked by the OS due to write access, user rights or similar circumstances, the procedure crashes with a System.UnauthorizedAccessException and complains that it couldn't rename the protected file:

Additional information: Access to the path 'X:\somepath\somefile.dllgvzqe1ca.rcq.PendingOverwrite' is denied.

It would be nice to get informed through the regular channels (events) but I would prefer if the copy process would go on. Or maybe an additional config property could be possible.

Commented Unassigned: UnauthorizedAccessException in ExtractAll stops extraction [17701]

$
0
0
Hello and due to some really impolite "Issues" some people seem to have (primarily and usually with themselves ;-) ) I first wish to thank the creator of this project.

Thank You.

Way better than the on-board C# API, sure, not perfect, but it's simple and works for me.

Now for the issue:
Whe using ExtractAll in conjunction with ExtractExistingFileAction.OverwriteSilently and one of the Entries is locked by the OS due to write access, user rights or similar circumstances, the procedure crashes with a System.UnauthorizedAccessException and complains that it couldn't rename the protected file:

Additional information: Access to the path 'X:\somepath\somefile.dllgvzqe1ca.rcq.PendingOverwrite' is denied.

It would be nice to get informed through the regular channels (events) but I would prefer if the copy process would go on. Or maybe an additional config property could be possible.
Comments: ** Comment from web user: xankunc **

Workaround: The obvious workaround is the extract all files individually and catch the situation.

Commented Unassigned: UnauthorizedAccessException: Access to the path 'C:\Windows\system32\DotNetZip-chjtrfby.tmp' is denied. [16382]

$
0
0
Hi,

I am facing below issue:
UnauthorizedAccessException: Access to the path 'C:\Windows\system32\DotNetZip-chjtrfby.tmp' is denied.

Any help is appreciated..
Comments: ** Comment from web user: xankunc **

see https://dotnetzip.codeplex.com/workitem/17701

Created Unassigned: Issue with asp.net stream to Chrome? [17703]

$
0
0
Hi,

I have a asp.net web application that generates a zipfile that is sent to the browser stream.

This application has been working fine until very recently. Now, in Chrome an error occurs: NETWORK_FAILED. In Internet Explorer it is still working fine.

Does anyone recognize this issue? Does it have to do with a new Chrome release? Does anyone have a solution for this issue?

Regards,

Mark

Commented Unassigned: Issue with asp.net stream to Chrome? [17703]

$
0
0
Hi,

I have a asp.net web application that generates a zipfile that is sent to the browser stream.

This application has been working fine until very recently. Now, in Chrome an error occurs: NETWORK_FAILED. In Internet Explorer it is still working fine.

Does anyone recognize this issue? Does it have to do with a new Chrome release? Does anyone have a solution for this issue?

Regards,

Mark
Comments: ** Comment from web user: jonescarvalho **

I am also having the same problem, you managed to find the solution?

Commented Unassigned: Issue with asp.net stream to Chrome? [17703]

$
0
0
Hi,

I have a asp.net web application that generates a zipfile that is sent to the browser stream.

This application has been working fine until very recently. Now, in Chrome an error occurs: NETWORK_FAILED. In Internet Explorer it is still working fine.

Does anyone recognize this issue? Does it have to do with a new Chrome release? Does anyone have a solution for this issue?

Regards,

Mark
Comments: ** Comment from web user: jonescarvalho **

I found the solution in google groups

https://productforums.google.com/forum/#!topic/chrome/8Aykgxa8kWU;context-place=topicsearchin/chrome/category$3ABeta


Resolution:
Found in Header by default Content-Length is sets "0"

by adding below line and it works fine for us..

Response.AddHeader("Content-Length", fileContent.Length.ToString());


abs


Commented Unassigned: Issue with asp.net stream to Chrome? [17703]

$
0
0
Hi,

I have a asp.net web application that generates a zipfile that is sent to the browser stream.

This application has been working fine until very recently. Now, in Chrome an error occurs: NETWORK_FAILED. In Internet Explorer it is still working fine.

Does anyone recognize this issue? Does it have to do with a new Chrome release? Does anyone have a solution for this issue?

Regards,

Mark
Comments: ** Comment from web user: mblom **

Thanks for the reply, issue is solved with Content-Length!

Commented Unassigned: .Save() hang [17698]

$
0
0
Hi

I am using the Ionic.zip.dll lib (v..9.1.8) for the first time
I have successfully written a simple .net console app to get a list of files and save them into a specified zip file (new each time)

It is so simple to use yet powerful, so Well DONE!

However, when I re-run the same code (inside vs2012 Pro) but on a larger number of files (>1000) some of which are a large size (e.g. several at 500mb) then the .Save(<filename>) method simply hangs and processing seems to freeze and VStudio is still running.
I can stop/pause and processing returns to VStudio

(It works with other tests and >1000 files but smaller in size than this, more typical, folder contents)

Whilst it is "processing" the destination folder contains a temp file "DotNetZip-ac1qi3yg.tmp"
if I copy and rename this to a ".zip" then I can open it but it fails to test and complains of errors in the file
(I guess its not complete)

Because of the 1000 files and some of which are 500mb, i left this to perform its magic for over an hour and still the same -no joy.

Is this normal, is there a limit on files/sizes or is there something else wrong?

In all cases I am using the .AddFiles( <list of files()>, <foldername>) as the method to add files
works when only smaller set of files

Any advise/pointers would be appreciated

thanks
Urfan
Comments: ** Comment from web user: Enigma644 **

I have this exact same issue. All my tests run fine, then I give my app a real word test with my documents folder and it hangs after creating a ~110MB temp file.
I'm doing .AddFiles() for ~17k files, then doing a .Save() and reporting progress with the SaveProgress event.

Each time it hangs, it's at roughly, but not exactly the same point.

Anyone got any suggestions?

New Post: Not working in Windows Service.

$
0
0
I've used this to create password protected zip file in the windows service. When I deploy the service on the server it gives error "could not find a part of the path C:\Windows\System32\TEmp\DotNetZip-ewtkhsc.tn" on zip.Save() line. I set below property to overcome this problem.

zip.TempFileFolder = applicationPath + "\Temp";

The path given above is the valid one and service has all permission (read, write) to this path. Still zip.Save() is giving me "could not find a part of the path" error.

Any help would be appreciated.

Thanks in advance.

Created Unassigned: Not working in windows service [17706]

$
0
0
I've used this to create password protected zip file in the windows service. When I deploy the service on the server it gives error "could not find a part of the path C:\Windows\System32\TEmp\DotNetZip-ewtkhsc.tn" on zip.Save() line. I set below property to overcome this problem.

zip.TempFileFolder = applicationPath + "\Temp";

The path given above is the valid one and service has all permission (read, write) to this path. Still zip.Save() is giving me "could not find a part of the path" error.

Any help would be appreciated.

Thanks in advance.

New Post: How to export .xls dynamically generated in .zip?

$
0
0
Hi, first of all I apologize if the topic has already been dealt, but I could not find the solution despite having read various posts.

My application (Asp.net> VB) generates an .xls file to Datatable, using NPOI library.

I wish that the xls file generated is released in .zip instead of .xls

I did several tests with DotNetZip and it works if the file takes him from a directori that I point Server.MapPath.

But I would like to get the xls file generated by NPOI directly in .zip

How can I do?

New Post: Sfx stub ‘useLegacyV2RuntimeActivationPolicy'?

$
0
0
I am using the DotNetzip NuGet package (v1.10.1) to dynamically create and download a Sfx package with a post extract command line that launches an application on the client.

If I download this Sfx to a Win81 or 2012r2 OS (which has .NET4) I get prompted to activate the .NET framework 3.5.

(My payload app.config files use the startup parameter ‘useLegacyV2RuntimeActivationPolicy="true"’ with ‘supportedRuntime’ versions 2 and 4 to allow them to run in a .net 4 environment without causing the activation prompt.)

How can I modify get a DotNetZip Sfx to have the same behavior?

Created Unassigned: Sfx stub ‘useLegacyV2RuntimeActivationPolicy'? [17717]

$
0
0
I am using the DotNetzip NuGet package (v1.10.1) to dynamically create and download a Sfx package with a post extract command line that launches an application on the client.

If I download this Sfx to a Win81 or 2012r2 OS (which has .NET4) I get prompted to activate the .NET framework 3.5.

(My payload app.config files use the startup parameter ‘useLegacyV2RuntimeActivationPolicy="true"’ with ‘supportedRuntime’ versions 2 and 4 to allow them to run in a .net 4 environment without causing the activation prompt.)

How can I modify the DotNetZip Sfx stub.exe to have the same behavior?

Created Unassigned: Override name of zip file doesn't work with overloaded AddFile method [17718]

$
0
0
I am adding files from various locations to a zip file. These files can potentially have the same name, so I am trying to version the those (adding (1), (2), etc to the name), but only within the zip file.
I am also specifying the path hierarchy within the zip file.
So, for example:


using (ZipFile zip = new ZipFile())
{
foreach (FileCollection dir in dirs)
{
var zipPath = path1 + "/" + path2 + "/";
foreach (FileObject file in files)
{
If (isDuplicated(file))
{
var newName = file.Filename + "(1)";
}
zip.AddFile(file.FullPath, zipPath).FileName = newName;
}
}
zip.Save(targetPath);
}

This doesn't work. I get an exception saying "An item with the same key has already been added."

If I remove the zipPath when calling the AddFile method, like so:

zip.AddFile(file.FullPath).FileName = newName;

...everything works fine.
This, it seems like the FileName setter is not working whenever the AddFile overload method is used.

Created Unassigned: sfx flavor = WindowsForms & Quiet does not exit without user interaction [17719]

$
0
0
I'm creating a sfx that runs Setup.exe. The sfx Flavor = WindowsFormsApplication, Quiet = true. According to the documentation for PostExtractCommandLineProperty,

"If you set Flavor to SelfExtractorFlavor.WinFormsApplication, and set Quiet to true, then a GUI with progressbars is displayed, but it is "non-interactive" - it accepts no input from the user. Instead the SFX just automatically unpacks and exits. "

The behavior that I observe is that the sfx does the extraction with a small dialog showing extraction progress, launches setup.exe, but instead of exiting, displays a Quit button on the dialog.

Created Unassigned: issue adding multiple files [17720]

$
0
0
Hello,

I am having 2 issue

1. with multiple files.
The behaviour is very randomn while using the put_ParallelDeflateThreshold(-1)
Some of the files are being randomnly skipped.
However when i commented above flag, it adds correctly. But the above flag was required to avoid corruption.

2. Once the zip file is created by adding the files, i am unable to delete the zip file. looks like its still being locked.

Any idea?

Thanks,
rln

Created Unassigned: Directory missing [17721]

$
0
0
I have a zip-file which is corrupted but DorNetZip is somehow enable to read it althoug the (zip)directory which should be located at the end of the file is missing. According to the documentation the ZipFile.Read() method scans the directory, but I won't get an error although the directory is missing.
It now seems that DotNetZip extracts the files in the zip by scanning the complete file. My understanding is that FullScan = false is you read the file with ZipFile.Read(). I also tried using the Initialize() method for reading with setting FullScan to both true and false, but I won't get an error. I'm using DotNetZip 1.10.1

New Post: Not working in Windows Service.

$
0
0
I would suggest your path is wrong.

zip.TempFileFolder = applicationPath + "\Temp";

"\temp" - the first two characters "\t" are escape sequence for a tab character, so you're actually getting:
zip.TempFileFolder = applicationPath + "<tab character>emp";

try either:

zip.TempFileFolder = applicationPath + @"\Temp";
zip.TempFileFolder = applicationPath + "\Temp";

or better yet: zip.TempFileFolder = Path.Combine(applicationPath + @"\Temp");

Also, when running as a service, it will generally run as either: NETWORK SERVICE, LOCAL SERVICE, LOCAL SYSTEM or a named user if you impersonate a user's account login.
What I'm trying to say is you may have access to the path (read & write access) but the account the service is actually running as: NETWORK SERVICE (for example) may not. To check what your service is running as. Load: services.msc, find your service, and click on the "Log On" tab.
Viewing all 664 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>