473,625 Members | 3,064 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 ZipWithExternal Batch(string input_file)

{

try

{

System.Diagnost ics.Process job = new System.Diagnost ics.Process();

job .StartInfo.File Name = "pkzip.exe" ;

job .StartInfo.Argu ments = "-add " +
ConfigurationMa nager.AppSettin gs["TargetZipF ile"].ToString()+ " " +
Server.MapPath( input_file);

job .StartInfo.UseS hellExecute = false;

job .StartInfo.Redi rectStandardOut put = true;

job .Start();

job .StandardOutput .ReadToEnd();

job.WaitForExit ();

catch (Exception ex)

{

AppLog.Write(ex );

}
Oct 19 '06 #1
1 1888
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.Diagnost ics.Process job = new System.Diagnost ics.Process();
job .StartInfo.File Name = "pkzip.exe" ;
job .StartInfo.Argu ments = "-add " +
ConfigurationMa nager.AppSettin gs["TargetZipF ile"].ToString()+ " " +
Server.MapPath( input_file);
job .StartInfo.UseS hellExecute = false;
job .StartInfo.Redi rectStandardOut put = 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
1981
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 script: ------------------------------------------------------------------ #!/bin/bsh LOG_NAME='/tmp/expzip.log' FILENAME='/tmp/expzip.dmp' /bin/mknod $FILENAME p
10
2737
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 of the rows that follow. The hope is that the result will not grow as large as a pure XML file, but still be easy to exchange. Multiple vendors would still be able to track format changes easily. The size of the flat file, without XML, is already...
0
1883
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 parallel computation. Key Benefits of SocketPro: Super performance and scalability It is a guarantee that SocketPro based client-server applications
1
10832
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 formatting then outputs the resulting file. What I am trying to do is have the program make as many files as is needed, each limited to a given file size (in this case 240KB).
2
1105
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 limited space on a server, and this is a considerable chunk. anyhow, is there a file extension which would reduce the .txt file size down, but that could still be read by a stream reader. Thanks, Jarry
1
2162
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
3224
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
1603
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 function call each of these functions. Here are the codes in the files: //****** hello.h void func_hello();
2
3205
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 compress the strings, if they are ASCII or unicode, how much quickly you want to compress/ decompress them, and how much time you have to write the encoder/ decoder.
0
8192
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8696
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8637
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8358
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8502
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6119
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5571
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
2621
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1504
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.