2 Answers
- Newest
- Most votes
- Most comments
1
Have you tried using the JS example listed here? https://docs.aws.amazon.com/AmazonS3/latest/userguide/example_s3_PutObject_section.html.
- for each file in the directory
- get the full path of the file
- Upload with the prefix
You can also try https://awscli.amazonaws.com/v2/documentation/api/latest/reference/s3/sync.html.
0
Try giving this a go. Recursively iterating through the directories and files in JavaScript.
Here you can find an example code snippet demonstrating the recursive directory upload process using the AWS SDK for JavaScript modules workaround [ 1 ].
References:
answered a year ago
The example you provided was for the Java SDK (I linked it in the original question) So this will not work for javascript/typescript.
Relevant content
- asked a year ago
- AWS OFFICIALUpdated 5 months ago
- AWS OFFICIALUpdated 9 months ago
- AWS OFFICIALUpdated a year ago
- AWS OFFICIALUpdated 10 months ago
The CLI command is the closest usable option so far. Thanks for calling attention to it. I need to be able to call the upload programmatically after a folder has been created. If using node
child_process
to call the sync through a Bash command is acceptable to my company then this might be the solution.