I want to send a recursive folder to amazon.
the folder: folder
└───FOLDER
├───SUBFOLDER
|
|__ file1.jpg
|
|__ file2.jpg
├───SUBFOLDER(2)
|
|__ file3.jpg
|
|__ file4.jpg
for this use:
asw s3 cp /folder s3://mybucket/folder_destination --recursive
but it arrives at the bucket with the same folder structure in the bucket.
my wish is that it reaches the bucket with this structure:
└───BUCKET
├───folder_destination
|
|__ file1.jpg
|
|__ file2.jpg
|
|__ file3.jpg
|
|__ file4.jpg
I tested this bat:
pushd C:\Users\user\Desktop\FOLDER
for /r %%a in (*.jpg) do (
aws s3 cp "%%a" "s3://bucket/Test/%%~nxa"
)
popd
he does what I want but very slowly.
for (File f : arquivos) {
System.out.println(f);
String fileObjKeyName = "Test" + f.toString().split("/")[f.toString().split("/").length - 1];
PutObjectRequest request = new PutObjectRequest(bucketName, fileObjKeyName, f);
ObjectMetadata metadata = new ObjectMetadata();
metadata.setContentType("image/jpeg");
//metadata.addUserMetadata("title", "someTitle");
request.setMetadata(metadata);
s3Client.putObject(request);
}
slow too
is there any way to send them quickly without the folder structure?