c# - System.IO.Packaging.PackagePart.GetStream() does not work if the package is hosted on a webserver (URL) -
I have a package hosted on a webserver (URL) (System.IO. Packaging.Package) and, if I feed the Package URL in the web browser I can download the package.
My requirement is to remove a file from the package (the section attached to the file) without downloading the entire package.
System Io There are classes for manipulating the packages in packaging. If this package is located on an SMB share, this class works well, but if the package is hosted on a web server, then fails to remove the file.
When I call the PackagePart.GetStream () method, an exception that says that the stream is written only and therefore a reading action can not be taken. I have tried to use overload of the package. The Open () and PackagePart.GetStream () method pass through allowing reading / writing, but still does not work.
If I correctly understand the stack trace, MS.Internal.IO.Zip.ZipIOLocalFileBlock._blockManager does not have permission to promote from PackagePart.GetStream () call.
Is this a bug? Did I do something wrong? Is there a work around? I have been fighting for more than two weeks to get the solution to this problem and there is no adequate document about the use of these sections.
PS: I already have some popular zip libraries (Sharpzipilib, Doontanet Zip and .NET 4.5 ZIP Advanced Class) they all fail to realize my requirement.
Thank you.
Comments
Post a Comment