473,500 Members | 1,822 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Compressing several files to the same zip file output!


Hello,
I use the code below to zip files to a single .zip destination. I get the
expected result when i work on my developement machine (WinXP sp.2).

When i deploy the web application which host the code on win2k3 , it only
works for a single file.

I gave the modify right to "Noetwork Service" on the folder i'm writing to.
It does not help.

Can someone tell me what i'm doing wrong?
Thanks
JJ
Code below:
protected void ZipWithExternalBatch(string input_file)

{

try

{

System.Diagnostics.Process job = new System.Diagnostics.Process();

job .StartInfo.FileName = "pkzip.exe";

job .StartInfo.Arguments = "-add " +
ConfigurationManager.AppSettings["TargetZipFile"].ToString()+ " " +
Server.MapPath(input_file);

job .StartInfo.UseShellExecute = false;

job .StartInfo.RedirectStandardOutput = true;

job .Start();

job .StandardOutput.ReadToEnd();

job.WaitForExit();

catch (Exception ex)

{

AppLog.Write(ex);

}
Oct 19 '06 #1
1 1874
Jens Jensen wrote:
I use the code below to zip files to a single .zip destination. I get the
expected result when i work on my developement machine (WinXP sp.2).

When i deploy the web application which host the code on win2k3 , it only
works for a single file.

I gave the modify right to "Noetwork Service" on the folder i'm writing to.
It does not help.
System.Diagnostics.Process job = new System.Diagnostics.Process();
job .StartInfo.FileName = "pkzip.exe";
job .StartInfo.Arguments = "-add " +
ConfigurationManager.AppSettings["TargetZipFile"].ToString()+ " " +
Server.MapPath(input_file);
job .StartInfo.UseShellExecute = false;
job .StartInfo.RedirectStandardOutput = true;
job .Start();
job .StandardOutput.ReadToEnd();
job.WaitForExit();
Permission problems, different version of pkzip or something
else.

I would suggest switch from Process.Start woth pkzio to
programmatic zipping (either #ZipLib or the java.util.zip hack).

Faster, less dependence on environment and better error
messages.

Arne
Oct 20 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
1976
by: Orr, Steve | last post by:
Oracle provides an export utility (exp) and I have a shell script which compresses its output (not stdout) thru a pipe but l need a platform portable Python script for this. Here's the shell...
10
2721
by: Dennis Farr | last post by:
It has been suggested that rather than convert an already large flat file, with many similar rows, to XML, some type of header be attached to the file, containing some sort of meta-XML description...
0
1874
by: Yuancai \(Charlie\) Ye | last post by:
Hi, All: I am happy to annouce that we have formally released our latest SocketPro version 4 at www.udaparts.com, an advanced remoting framework written from batching/queue, asynchrony and...
1
10761
by: TJ | last post by:
I am very new to C# (this is my first real project), therefore please be patient if my question is considered being to newbie. I am modifying a program which takes a text file, does some...
2
1097
by: Jarry | last post by:
I am a bit new to VB, and I have set up a program which loads a large text file. The text file (.txt) has a file size of around 6 megabytes. This is the figure I would like to rreduce. I have...
1
2159
by: HTB | last post by:
Hi, Are there programs for compressing video files just like WinZip & WinRar for text files in a lossless way !!!?
3
3211
by: msankardas | last post by:
Hi, As a part of my project, i need to compress folders and files into a single zip file as follows. for eg: I want to compress C:\test\ c:\compression\ C:\documents\test.txt
4
1598
by: jewel87 | last post by:
Hi everyone! I am trying to compile a very simple program on UNIX, which consists of several files, each of them has a function that prints out a string of text. Then the file with the main...
2
3192
by: bearophileHUGS | last post by:
Helmut Jarausch: Asking in comp.compression is a good starting point. My suggestions (sorry if they look a bit unsorted): it depends on what language you want to use, how much you want to...
0
7182
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7232
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
6906
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7397
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5490
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
4923
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4611
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3106
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
672
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.