You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am getting the following error when trying to instantiate a ZipArchive object using Sftp file stream.
message='Exception: System.IO.InvalidDataException: Central Directory corrupt.
[2022-10-21T14:16:36.733Z] ---> System.IO.IOException: Zip file corrupt: unexpected end of stream reached.
[2022-10-21T14:16:36.734Z] at System.IO.Compression.ZipHelper.ReadBytes(Stream stream, Byte[] buffer, Int32 bytesToRead)
[2022-10-21T14:16:36.734Z] at System.IO.Compression.ZipHelper.SeekBackwardsAndRead(Stream stream, Byte[] buffer, Int32& bufferPointer)
[2022-10-21T14:16:36.736Z] at System.IO.Compression.ZipHelper.SeekBackwardsToSignature(Stream stream, UInt32 signatureToFind, Int32 maxBytesToRead)
[2022-10-21T14:16:36.736Z] at System.IO.Compression.ZipArchive.ReadEndOfCentralDirectory()
[2022-10-21T14:16:36.737Z] --- End of inner exception stack trace ---
[2022-10-21T14:16:36.737Z] at System.IO.Compression.ZipArchive.ReadEndOfCentralDirectory()
[2022-10-21T14:16:36.738Z] at System.IO.Compression.ZipArchive..ctor(Stream stream, ZipArchiveMode mode, Boolean leaveOpen, Encoding entryNameEncoding)
[2022-10-21T14:16:36.739Z] at System.IO.Compression.ZipArchive..ctor(Stream stream, ZipArchiveMode mode, Boolean leaveOpen)
Looking at the backtrace, looks like when trying to read from the end of file it is getting this error: Zip file corrupt: unexpected end of stream reached.
my code is simple:
using(var remoteStream = sftpclient.OpenRead(filepath)
using(var zip = new ZipArchive(stream: remoteStream, mode: ZipArchiveMode.Read, leaveOpen: true))
{
...
}
The text was updated successfully, but these errors were encountered:
I am getting the following error when trying to instantiate a ZipArchive object using Sftp file stream.
Looking at the backtrace, looks like when trying to read from the end of file it is getting this error: Zip file corrupt: unexpected end of stream reached.
my code is simple:
The text was updated successfully, but these errors were encountered: