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

Error uploading a file #311

Open
dortamiguel opened this issue Aug 29, 2016 · 2 comments
Open

Error uploading a file #311

dortamiguel opened this issue Aug 29, 2016 · 2 comments

Comments

@dortamiguel
Copy link

I'm using this code for uploading an image, I follow the docs but I'm getting an 301 error from amazon. Is this a bug in knox? The amazon cli uploads my files just fine.

require('dotenv').config()
var knox = require('knox')

var client = knox.createClient({
    key: process.env.S3_KEY,
    secret: process.env.S3_SECRET,
    bucket: process.env.S3_BUCKET
});

var file = "image.jpg"
var upload_name = "upload_" + file

client.putFile(file, upload_name, {"Content-Type": "image/jpeg"}, function (err, result) {
    if (err != null) {
        return console.log(err)
    } else {
        console.log(result.statusCode)
        return console.log("Uploaded to amazon S3")
    }
})
@clementohNZ
Copy link

I also have the same issue.

@sundarapandian18
Copy link

I too have the same issue.

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

No branches or pull requests

3 participants