Reading Partial Zip content #505
Replies: 5 comments 9 replies
-
You're using the legacy version of zip.js (i.e. < 2.x) which has been abandoned more than 4 years ago. You have to update zip.js to the last version. |
Beta Was this translation helpful? Give feedback.
-
@gildas-lormeau Do you know of a way to get a callback or promise on painting an image to the UI? We have some timers involved with the slideshow and at some points things get out of sync. The idea would be to initiate our interval after the image is painted to ensure nothing is missed. |
Beta Was this translation helpful? Give feedback.
-
@gildas-lormeau Do you have a way to easily cancel HTTP requests from the HttpRangeReader? |
Beta Was this translation helpful? Give feedback.
-
@TJ-Edwards You should be able to set the You can also set the |
Beta Was this translation helpful? Give feedback.
-
@gildas-lormeau Yea I am trying to with the following but not having any luck yet. Sample below. public abortPromise = new AbortController(); cancel(){
... |
Beta Was this translation helpful? Give feedback.
-
Hello,
I am having an issue with parsing a partial zip request. My scenario is that I need to be able to read images out of the archive, but due to the size I want to retrieve the content in chunks. However, I believe I am missing something. Whenever I try to process my blob, I get the following error.
//blob
size: 1124376968
type: "application/zip"
//Error
ZipExtractor.ts:23 ERROR Error: Uncaught (in promise): File format is not recognized.
Currently I am just retrieving a random byte range based on the archive size. This is a very temporary approach to see if partial reads could be accomplished. I realize I might be cutting files off because I dont have the central directory. I plan on getting that from an external source and not the library itself. Does anyone see this as being a potential problem?
For a bit more context I am using the ZipExtractor class provided in the repo for parsing the blob. I did some messing around to force the blob type to see if that would help, but that did not work out.
//ZipExtractor.ts
export interface ZipContent {
[filePath: string]: {
name: string
content: string
}
}
export class ZipExtractor {
public extract(zipData: Blob): Promise {
zipData = zipData.slice(0, zipData.size, "application/zip");
let zipContent: ZipContent = {};
return new Promise((resolve, reject) => {
zip.createReader(new zip.BlobReader(zipData), (zipReader) => {
let beginDate: Date = new Date();
console.info(
zip reader opened at ${beginDate}
, zipData);}
Any guidance here would be greatly appreciated! Thank you for your time.
Beta Was this translation helpful? Give feedback.
All reactions