Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Only first 65 397 bytes get uploaded #1

Closed
robertrossmann opened this issue Mar 24, 2015 · 1 comment
Closed

Only first 65 397 bytes get uploaded #1

robertrossmann opened this issue Mar 24, 2015 · 1 comment
Assignees

Comments

@robertrossmann
Copy link
Contributor

Hi! I am trying to upload an image/jpeg file into my Azure container. My file is 286 025 bytes large, but only first 65 397 bytes get uploaded - after that, the adapter fires my callback and reports a successful operation.

Interesting to note is that the uploaded file is consistently truncated to 65 397 bytes even after multiple attempts.

Here is a short code that I use:

return new Promise(function upload (resolve, reject) {
  // Upload! blobStore contains skipper-azure as adapter and all necessary keys and secrets
  req.file('photo').upload(sails.config.connections.blobStore, function (err, files) {
    // Error occured?
    if (err)
      return reject(err)

    // Did we upload anything?
    if (! files.length)
      err = new Error('No files uploaded!')

    return resolve(files[0])    // We only upload one at a time
  })
})

And I upload my file with curl:

curl -X POST -F "photo=@/path/to/test.jpg" http://localhost:000/contacts/1/photo

After that, Sails sends me the expected response and closes the connection normally. Could this be a bug in the module...?

Thanks for any guidance in this matter!

@lukasredev
Copy link
Owner

Fixed in the newest commit. I'll also update the npm version soon.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants