Skip to content
This repository has been archived by the owner on Feb 12, 2021. It is now read-only.

putObject uploads partially for data over 1.4 MB #193

Open
ssshah5 opened this issue Oct 5, 2017 · 0 comments
Open

putObject uploads partially for data over 1.4 MB #193

ssshah5 opened this issue Oct 5, 2017 · 0 comments

Comments

@ssshah5
Copy link

ssshah5 commented Oct 5, 2017

Hello,

I have been using the s3 library the following way and have been seeing issues for data uploads larger than 1.4MB.

s3    = require('s3');

var s3Params = {
  maxAsyncS3: 20,
  s3RetryCount: 3,
  s3RetryDelay: 1000,
  s3Options: {
    accessKeyId: config.s3AccessKeyId,
    secretAccessKey: config.s3SecretAccessKey,
    region: config.s3Region,
    endpoint: config.s3Endpoint,
    sslEnabled: true,
    s3ForcePathStyle: true
  }
};

var client = s3.createClient(s3Params);
var clientS3 = client.s3;

var params = {Bucket: s3LogsBucketName, Key: options.container + '/' + options.name, Body: options.content};
            clientS3.putObject(params, function (err, data) {
                if (err) {
                    logger.error("failed to upload file", err);
                    return reject(err);
                } else {
                    console.log(data);
                    return resolve();
                }
            });

The options.content/data is binary data.

For smaller data, it works fine and uploads the complete data to the Object Store. However for large data it seems to be uploading only partial data. No errors are reported but when I open the file on Object Storage, it has missing data at the end. This behavior is consistent.

I also tried using clientS3.upload() but instead of clientS3.putObject() but its not able to find the upload() function. Would appreciate any help/suggestions here.

Thank you.

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

1 participant