Search code examples
node.jsamazon-s3knox-amazon-s3-client

How to upload all files from directory to s3


I am writing node js script which should send images from directory '/images/', to the amazon s3. I know the knox is very good library, but how can I upload all files from directory, with the old file names. I can probably use fs module, get all names and upload it with for loop. Is there any function in knox which can do this?


Solution

  • Knox does not provide any functionality for client-side file handling. You need to find your files manually and upload them one after one.

    Unfortunately its impossible to upload multiple files once. The problem is that S3 requires that you send the Content-Length header for every file.