Note that there are some explanatory texts on larger screens.

plurals
  1. POZIP file gets corrupted during upload to S3
    primarykey
    data
    text
    <p>I'm using node.js and knox's putFile to upload a zip file to S3. The original zip opens fine, the zip download from S3 is corrupt.</p> <p>Here's the relevant code I'm using:</p> <pre><code>var client = knox.createClient({ key: 'MY KEY HERE', secret: 'MY SECRET HERE', bucket: 'MY BUCKET HERE' }); var filename = 'example.zip'; var req = client.putFile(filename, filename, { 'x-amz-acl': 'public-read' }, function(err, res){ if (res.statusCode == 200) { console.log('moved '+filename+' to s3'); } else { console.log('failed to move to s3'); } }); </code></pre> <p>This is the output I get when trying to fix the zip file using zip in terminal on OSX</p> <pre><code>&gt; zip -F remote.zip --out fixed-remote.zip Fix archive (-F) - assume mostly intact archive zip warning: bad archive - missing end signature zip warning: (If downloaded, was binary mode used? If not, the zip warning: archive may be scrambled and not recoverable) zip warning: Can't use -F to fix (try -FF) zip error: Zip file structure invalid (remote.zip) &gt; zip -FF remote.zip --out fixed-remote.zip zip warning: Missing end (EOCDR) signature - either this archive is not readable or the end is damaged &gt; Is this a single-disk archive? (y/n): y Assuming single-disk archive [LISTS ALL FILES COPIED HERE] zip warning: no end of stream entry found: awesome-file.jpg zip warning: rewinding and scanning for later entries </code></pre> <p>I'm totally lost as to why this would be happening. Almost seems as though the last couple bytes aren't being sent by knox, but that's a total rookie guess.</p> <p>Anyone have any ideas?</p> <p><strong>UPDATE:</strong></p> <p>I think it may be an issue with generating the ZIP file, not the upload. I tried uploading zip file generated by the OSX Zip Utility and it work fine every time. I'll dig into this a little deeper. Thanks for the help.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload