Giter Site home page Giter Site logo

bad zipfile offset about node-archiver HOT 13 CLOSED

archiverjs avatar archiverjs commented on May 26, 2024
bad zipfile offset

from node-archiver.

Comments (13)

andrecaribe avatar andrecaribe commented on May 26, 2024

I tried to append some images manually but I got same result.

archive
  .append(fs.createReadStream('/var/www/files/exercises/questions/612_256x256.jpg'), { name: 't_001.jpg' })
  .append(fs.createReadStream('/var/www/files/exercises/questions/613_256x256.jpg'), { name: 't_002.jpg' })
  .append(fs.createReadStream('/var/www/files/exercises/questions/614_256x256.jpg'), { name: 't_003.jpg' })
  .append(fs.createReadStream('/var/www/files/exercises/questions/615_256x256.jpg'), { name: 't_004.jpg' })
  .append(fs.createReadStream('/var/www/files/exercises/questions/616_256x256.jpg'), { name: 't_005.jpg' });

The images are not corrupted according to the jpeginfo and exiftool.

from node-archiver.

ctalkington avatar ctalkington commented on May 26, 2024

What OS, platform, node version? I've only seen one other report of such errors and that was on Mac OSX which I unfortunately am unable to test locally.

from node-archiver.

andrecaribe avatar andrecaribe commented on May 26, 2024

The package is generated on Debian Wheezy (7.1), Node v0.10.13
I test zip files on Debian and Mac OS X 10.7.5

UPDATE:
Node was compiled with:

{ 'target_defaults': { 'cflags': [],
  'default_configuration': 'Release',
  'defines': [],
  'include_dirs': [],
  'libraries': []},
  'variables': { 'clang': 0,
    'gcc_version': 47,
    'host_arch': 'x64',
    'node_install_npm': 'true',
    'node_prefix': '',
    'node_shared_cares': 'false',
    'node_shared_http_parser': 'false',
    'node_shared_libuv': 'false',
    'node_shared_openssl': 'false',
    'node_shared_v8': 'false',
    'node_shared_zlib': 'false',
    'node_tag': '',
    'node_unsafe_optimizations': 0,
    'node_use_dtrace': 'false',
    'node_use_etw': 'false',
    'node_use_openssl': 'true',
    'node_use_perfctr': 'false',
    'node_use_systemtap': 'false',
    'python': '/usr/bin/python',
    'target_arch': 'x64',
    'v8_enable_gdbjit': 0,
    'v8_no_strict_aliasing': 1,
    'v8_use_snapshot': 'true'}}

from node-archiver.

ctalkington avatar ctalkington commented on May 26, 2024

should really be fine, do you get same unzip test results on both platforms? ive only seen it on Mac.

from node-archiver.

ctalkington avatar ctalkington commented on May 26, 2024

do the zips open with Mac's Archive tool?

you might also try listening for outputs close event, finalize doesn't always promise that other streams have completed. also, not sure the point of the fs.writeFile you wrapped it all in?

from node-archiver.

andrecaribe avatar andrecaribe commented on May 26, 2024

Yes, same results on both.

I moved the response to output.on('close', ... and moved the code to out of fs.writeFile for tests. Same results. Sometimes - if the zip file don't have "bad zipfile offset" - the file open with success.
If has error, Mac's Archive tool shows an message:

'Unable to unarchive "XYZ.zip" into "FOLDER".
(Error 2 - No such file or directory exists.)'

Mac's Terminal and Debian 7.1 unzip, extract only files without bad offset.

I tried to use tar instead of zip and it worked fine, but I can not give output with tar or tar.gz

Node 0.10.13 changes some things about zlib. That will influence the archiver? http://blog.nodejs.org/2013/07/09/node-v0-10-13-stable/

from node-archiver.

ctalkington avatar ctalkington commented on May 26, 2024

hum don't think node version is the issue. could you email me the file you are testing locally?

from node-archiver.

andrecaribe avatar andrecaribe commented on May 26, 2024

Yes, of course. What you need? I created a simple test and got the same error. I'll send you.

from node-archiver.

ctalkington avatar ctalkington commented on May 26, 2024

ok, send along that project dir (just need js and package.json, no node_modules) and the zip you get from running it so I can see if the binary contents vary in any key spots.

EDIT: email is on my GH profile.

from node-archiver.

ctalkington avatar ctalkington commented on May 26, 2024

sorry for delay. will try out this coming week.

from node-archiver.

ctalkington avatar ctalkington commented on May 26, 2024

the zip you sent definitely fails 7zip and unzip on Windows for me. wasnt able to do much with the test since I dont have local files to match.

from node-archiver.

ctalkington avatar ctalkington commented on May 26, 2024

can you do me a favor and try running your test with:

var archive = archiver('zip', { zlib: { level: 0 } } );

from node-archiver.

ctalkington avatar ctalkington commented on May 26, 2024

checkout #32 and the latest release.

from node-archiver.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.