User (Old forums)MemberJanuary 29, 2008 at 8:30 amPost count: 23064
I glanced through the titles of the other threads before posting this and did not find quite the same problem, so I am posting this.
What I am doing is relatively simple. I am taking a zipped file created by one windows service, then unzipping it with another service to a temp directory, use the files from the zipped file to create a master directory file, then rezip all of the files back into a newly created zip file, but with the name of the original zip file.
The error I am encountering is this:
Xceed.Zip.InvalidZipStructureException: Could not find a local header where one was expected in the zip file.
Zip file: C:\Images\SLD001\TransferPending\SLD001-Banks_Brenda-20080128.zip
at Xceed.FileSystem.AbstractFolder.CopyFilesTo(FileSystemEvents events, Object userData, AbstractFolder destinationFolder, Boolean recursive, Boolean replaceExistingFiles, Object filters)
at Xceed.FileSystem.AbstractFolder.CopyFilesTo(AbstractFolder destinationFolder, Boolean recursive, Boolean replaceExistingFiles, Object filters)
at Dicom_Router_SLDSend.Dicom_Router_SLDSend.ProcessTransfer(String PollingFolder) in J:\Eric Development\MMP Dicom Router\Dicom_Router_SLDSend\Dicom_Router_SLDSend\Dicom_Router_SLDSend.vb:line 417
Now what I am not understanding is that the code I am using in both services is basically the same code. Only the source directory and path name of the newly create zip file have changed.
Dim ZipFilename As String = oConfig.PollingFolder & NewFileName ‘CurrFile.FullName
If IO.File.Exists(ZipFilename) Then
Dim NewZipFile As New Xceed.FileSystem.DiskFile(ZipFilename)
Dim xcZip As New Xceed.Zip.ZipArchive(ZipFile)
.DefaultEncryptionMethod = Xceed.Zip.EncryptionMethod.WinZipAes
.DefaultEncryptionStrength = 256
.DefaultEncryptionPassword = oConfig.AESKey
.DefaultDecryptionPassword = xcZip.DefaultEncryptionPassword
.DefaultCompressionLevel = Xceed.Compression.CompressionLevel.Highest
.DefaultCompressionMethod = Xceed.Compression.CompressionMethod.Deflated
Dim ZipSourceFolder As New Xceed.FileSystem.DiskFolder(oConfig.PollingFolder & “Temp\”)
ZipSourceFolder.CopyFilesTo(xcZip, True, True, “*”)
I am at a loss here. Any help would be grearly appreciated.
Imported from legacy forums. Posted by Eric (had 3027 views)Xceed SupportMemberFebruary 4, 2008 at 3:52 pmPost count: 5658
After reviewing the complete code, the System.IO.FileInfo and System.IO.DirectoryInfo classes were used in combination with the FileSystem. Because those classes were keeping a reference on the instances of the file, when the FileSystem tried to access them (deleting, moving files), the error (Xceed.Zip.InvalidZipStructureException) is thrown.
Imported from legacy forums. Posted by CharlesB (had 3622 views)
- You must be logged in to reply to this topic.