Questions tagged [knox-amazon-s3-client]

Use this tag for questions related to the js library knox: a node.js plugin for Amazon S3

This open source project (hosted on github) is an client for

Main features (as described on the project site) :

  • Familiar API (client.get(), client.put(), etc.)
  • Very Node-like low-level request capabilities via http.Client
  • Higher-level API with client.putStream(), client.getFile(), etc.
  • Copying and multi-file delete support
  • Streaming file upload and direct stream-piping support

Knox can be installed with npm install knox

88 questions
4
votes
2 answers

node.js expressjs proxy static from amazon s3

When a request comes in for a page, eg app.get("/") I want to return a static HTML page from amazon s3. I know I can request it from S3 and then send it, but that seems slow. Is there anyway to tell the requester to get the file from s3 directly…
Harry
  • 52,711
  • 71
  • 177
  • 261
3
votes
0 answers

Create Signed S3 URL with NodeJS & Knox - with headers

I am trying to create a signed s3 url using NodeJS and Knox. var knox = require('knox'); var s3Client = knox.createClient({ key: 'XXX', secret: 'XXX', bucket: 'XXX' }); var expires = new Date(); expires.setMinutes(expires.getMinutes() +…
Kit
  • 4,095
  • 7
  • 39
  • 62
3
votes
1 answer

AWS S3 ListBuckets operation: Access Denied

I'm trying to list buckets following the boto3 documentation. import boto3 s3 = boto3.client(service_name = 's3', region_name = 'us-east-2', aws_access_key_id='xxxxxx', aws_secret_access_key=…
user8314628
  • 1,952
  • 2
  • 22
  • 46
3
votes
1 answer

ZIP file gets corrupted during upload to S3

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. Here's the relevant code I'm using: var client = knox.createClient({ key: 'MY KEY HERE', secret: 'MY SECRET…
chriserwin
  • 1,222
  • 1
  • 10
  • 13
2
votes
2 answers

Remove all files from s3 bucket using nodejs knox?

I am using knox npm module to upload files to a bucket on S3. It works great. What I am not sure how to do is how to remove all the files from a bucket in one call instead of deleting one file at the time? any idea would help...
zumzum
  • 17,984
  • 26
  • 111
  • 172
2
votes
1 answer

Change header on s3 file

If I have a file on s3 how can I change metadata of that file? It looks like I can "copy" it to the same location with new headers which would effectively be the same thing. I'm using knox as the node client to do this. The file in question already…
dylanjha
  • 2,303
  • 4
  • 28
  • 47
2
votes
2 answers

Listing all S3 Objects on a bucket named after a subdomain

I need a complete listing of all the objects in an s3 bucket with a particular prefix. I have tried using previously mentioned solutions using boto and knox-copy, however, my bucket is named after a domain (ex: cdn.mycompany.com) and I get the…
2
votes
1 answer

Can we upload image directly from url to amazon S3

I am using nodejs and trying to upload file from url to amazon s3 directly. Here is my code knox.putFile('http://www.wikihow.com/Image:Make-Handprint-Art-Step-1.jpg','foldername/'+new_image_name, {"Content-Type": "image/jpeg",'x-amz-acl':…
Hitu Bansal
  • 2,917
  • 10
  • 52
  • 87
2
votes
1 answer

amazon s3 unable to open pdf file in IE

I uploaded a pdf to s3 and am using signed url. passing the amazonHeaders for content-disposition(I am geting back the response header for content-disposition). For this I put a patch in client.js in KNOX var signature = auth.signQuery({ …
coool
  • 8,085
  • 12
  • 60
  • 80
2
votes
2 answers

Streaming file to S3 "Error: stream ended unexpectedly"

Update: I believe that this could be caused by the fact that I'm using the body parser provided by express. Could this be messing with the stream that multiparty is trying to parse? I'm basing my solution on this answer. What I'm trying to do:…
kentcdodds
  • 27,113
  • 32
  • 108
  • 187
2
votes
1 answer

How do I stream a file from NodeJS to Amazon S3, using Knox?

I'm very new to streams in NodeJS - basically clueless about them - and I'm trying to get the KnoxJS client for Amazon S3 to stream a file from an HTTP GET. The sample code on the Knox github page shows…
2
votes
1 answer

knox S3 upload corrupted or truncated file

This is a brain teaser question where I actually know the answer. I'm throwing a bounty on it because it represents a valuable Node programming safety tip (and that's the first hint). Hint 2: In an HTTP request, what are the units of the…
mjhm
  • 16,497
  • 10
  • 44
  • 55
2
votes
1 answer

Amazon S3 PUT throws "SignatureDoesNotMatch"

This AWS security stuff is driving me nuts. I'm trying to upload some binary files from a node app using knox. I keep getting the infamous SignatureDoesNotMatch error with my key/secret combination. I traced it down to this: with e.g. Transmit, I…
DaGaMs
  • 1,521
  • 17
  • 26
2
votes
1 answer

Problems downloading a binary file with aws-sdk

I'm switching my server over from knox to the official aws-sdk, but I'm having some discrepancies with the end results. In aws-sdk, I use getObject to get a file in this manner: svc.client.getObject({Bucket:"someBucket", Key:file, …
2
votes
1 answer

which way is better for put file to amazon s3 from server?

I want provide a rest service api by restify ( or express ) the duty of service is let client who could put audio/mpeg or other binary file to our server, and then verify the authentication, if pass, put the file to amazon s3, and then check the s3…
PatrickSCLin
  • 1,419
  • 3
  • 17
  • 45