Если вы хотите загрузить файл в указанную папку c, то все, что вам нужно сделать, это добавить префикс пути к имени папки в свой первый ключевой параметр метода Amplify.Storage.uploadFile()
.
Для Пример
Допустим, вы хотите загрузить свои файлы в папку с именем «game».
// Name of your folder with '/' in the end to make it like path prefix
String folderGame = "game/";
// here we just adding it before the name of your file
String key = folderGame +"filenmae.txt";
/* now the value in key will look like "game/filenmae.txt" and pass it in
method as first parameter where you were passing the name previously */
Amplify.Storage.uploadFile(
key,
filename.getAbsolutePath(),
new ResultListener<StorageUploadFileResult>() {
@Override
public void onResult(StorageUploadFileResult result) {
Log.i("StorageQuickStart", "Successfully uploaded: " + result.getKey());
}
@Override
public void onError(Throwable error) {
Log.e("StorageQuickstart", "Upload error.", error);
}
}
);
Extra
для других методов, таких как Download, Remove et c. Вы должны сделать то же самое, чтобы получить доступ к этим файлам. просто добавьте префикс