Skip to content

RangeError: Attempt to allocate Buffer larger than maximum size: 0x3fffffff bytes #123

Closed
@meetwudi

Description

@meetwudi

I am using node-webkit with qiniu/nodejs-sdk. I am uploading an 7KB image with following code, almost identical to the code in examples.

  function getUploadToken(bucketName) {
    var putPolicy = new qiniu.rs.PutPolicy(bucketName);
    return putPolicy.token();
  }
  function uploadFile(localFile, key) {
    var extra = new qiniu.io.PutExtra(),
      token = getUploadToken($('#bucket_name').val());

    qiniu.io.putFile(token, key, localFile, extra, function(err, ret) {
      if(!err) {
        console.log(ret.key, ret.hash);
      } else {
        console.log(err);
      }
    });
  }

But when I try to upload the image, I got a RangeError: Attempt to allocate Buffer larger than maximum size: 0x3fffffff bytes.
screen shot 2014-11-03 at 6 39 25 pm

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions