V
VijayV
Hi all,
I am working on a webapplication and trying to implement a logic of
downloading a .zip file when user clicks on a particular button.
This .zip file should be generated dynamically.
For this, I am using ZipOutputStream class. I am passing my string
(which should be converted as a .zip file) and outputstream. Please
see the below code.
System.Text.ASCIIEncoding encoder = new System.Text.ASCIIEncoding();
byte[] buffer = encoder.GetBytes(toBeZippedString);
ZipOutputStream zipOutputStream = new ZipOutputStream(outputStream);
zipOutputStream.SetLevel(6); // 0 - store only to 9 - means best
compression
ZipEntry entry = new ZipEntry(GetFileName() + "." +
paymentFileType.ToLower().Trim());
entry.DateTime = DateTime.Now;
ICSharpCode.SharpZipLib.Checksums.Crc32 crc = new
ICSharpCode.SharpZipLib.Checksums.Crc32();
entry.Size = buffer.Length;
crc.Reset();
crc.Update(buffer);
entry.Crc = crc.Value;
zipOutputStream.PutNextEntry(entry);
zipOutputStream.Write(buffer, 0, buffer.Length);
zipOutputStream.Finish();
zipOutputStream.Close();
After executing this logic, user should get a popup window with
the .zip file from server with OPEN, SAVE, Cancel options.
This entire logic is working from my development PC. But, where as
when I deploy this at production server, I am getting an unhandled
exception (Whic is recorded at event log) like below
User:
Is authenticated: False
Authentication Type:
Thread account name: NT AUTHORITY\NETWORK SERVICE
Can anybody help me why this is occuring and what is the fix for this?
Thanks in advance and will be looking for the solution of this.
Thanks
VijayV
I am working on a webapplication and trying to implement a logic of
downloading a .zip file when user clicks on a particular button.
This .zip file should be generated dynamically.
For this, I am using ZipOutputStream class. I am passing my string
(which should be converted as a .zip file) and outputstream. Please
see the below code.
System.Text.ASCIIEncoding encoder = new System.Text.ASCIIEncoding();
byte[] buffer = encoder.GetBytes(toBeZippedString);
ZipOutputStream zipOutputStream = new ZipOutputStream(outputStream);
zipOutputStream.SetLevel(6); // 0 - store only to 9 - means best
compression
ZipEntry entry = new ZipEntry(GetFileName() + "." +
paymentFileType.ToLower().Trim());
entry.DateTime = DateTime.Now;
ICSharpCode.SharpZipLib.Checksums.Crc32 crc = new
ICSharpCode.SharpZipLib.Checksums.Crc32();
entry.Size = buffer.Length;
crc.Reset();
crc.Update(buffer);
entry.Crc = crc.Value;
zipOutputStream.PutNextEntry(entry);
zipOutputStream.Write(buffer, 0, buffer.Length);
zipOutputStream.Finish();
zipOutputStream.Close();
After executing this logic, user should get a popup window with
the .zip file from server with OPEN, SAVE, Cancel options.
This entire logic is working from my development PC. But, where as
when I deploy this at production server, I am getting an unhandled
exception (Whic is recorded at event log) like below
User:
Is authenticated: False
Authentication Type:
Thread account name: NT AUTHORITY\NETWORK SERVICE
Can anybody help me why this is occuring and what is the fix for this?
Thanks in advance and will be looking for the solution of this.
Thanks
VijayV