Skip to content
This repository has been archived by the owner on Sep 13, 2022. It is now read-only.

when user select file from dialog, isZipFile return false #8

Closed
misaz opened this issue Mar 30, 2013 · 1 comment
Closed

when user select file from dialog, isZipFile return false #8

misaz opened this issue Mar 30, 2013 · 1 comment

Comments

@misaz
Copy link

misaz commented Mar 30, 2013

Good morning,
I make web application. I have small problem. User select zip file from your computer and i have blob from it. My code for load zip is:

var readerWorker = new FileReader()
var fileWorker = fileForOpen.files[0]
readerWorker.onload = function (e) {
      var text = e.target.result
      text = text.toString().substring(41)
      var zip = new JSUnzip(text)
      var isZip = zip.isZipFile()
      if (isZip) {
            zip.readEntries()
            for (var file in zip.entries) {
                  var withoutCompression
                  if (file.compressionMethod === 0) {
                        withoutCompression = file.data
                  } else if (file.compressionMethod === 8) {
                        withoutCompression = JSInflate.inflate(file.data)
                  }
            }
      }
}
readerWorker.readAsDataURL(fileWorker)

In the variable text is for example:

UEsDBAoAAAAAALKDfkLEb0P5GwAAABsAAAAIAAAAZGF0YS50eHRhYWFhYQpiYmJiCjI1CkdyYWZpawpjY2NjY2NQSwMECgAAAAAAwoN+QnOXrZQ4AAAAOAAAAAgAAABmb3RvLmpwZ3WrWopmoHv4In22rHuuEdJRjg3YQUABQCAAgAAAAD/3gAsAAAAAAUABQAAAgiMD5FnqwpSAQA4AUEsBAhQACgAAAAAAsoN+QsRvQ/kbAAAAGwAAAAgAAAAAAAAAAAAAAAAAAAAAAGRhdGEudHh0UEsBAhQACgAAAAAAwoN+QnOXrZQ4AAAAOAAAAAgAAAAAAAAAAAAAAAAAQQAAAGZvdG8uanBnUEsFBgAAAAACAAIAbAAAAJ8AAAAAAA==

If I debug it, I see in variable isZip value false. Why?

@augustl
Copy link
Owner

augustl commented Jan 18, 2016

Hey!

I just deprecated this project. I was looking into fixing bugs and updating it, but I found a much better alternative that didn't exist when I created this project. Check it out :)

https://gildas-lormeau.github.io/zip.js/

@augustl augustl closed this as completed Jan 18, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants