Skip to content

is there a way to download multiple files from s3 bucket nodejs. specific files not all files in s3 bucket

0

is there a way to download multiple files from s3 bucket nodejs. specific files not all files in s3 bucket?

asked 2 years ago611 views
2 Answers
1

Did you consider using "include" and "exclude" filters while using s3 sync or cp CLI. I assume, your nodejs specific files would certain defined prefix or suffix.

You can try something like this:

               aws s3 sync s3://bucketname/ . --exclude "*" --include "nodejs_files_pattern*"

Let me know if that doesn't help. Happy to assist further.

Abhishek

AWS
EXPERT
answered 2 years ago
1

Hello,

It is possible to download the specific files with prefix and suffix. In your case you have requirement to download only .js extension files so follow this CLI Command to get the files.

aws s3 cp s3://your-bucket-name/path/to/your/folder . --recursive --exclude "*" --include "*.js"

Replace your bucket name and your directory path to filter files in your bucket.

Thank You

EXPERT
answered 2 years ago
EXPERT
reviewed 2 years ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.