Is there any option for specifying custom path for the s3 upload. Everytime it is saving as Year>Month>date>UUID.csv. I need to save to a different path
Hi @krivopustov Thanks for the reply
I have created and override the AwsFileStorage
public class CustomAwsFileStorage extends AwsFileStorage {
@Override
protected String createFileKey(String fileName) {
System.out.println(“Custom class triggered”);
return fileName;
}
}
but when i try like this it is throwing cast exception.
CustomAwsFileStorage fileStorage = (CustomAwsFileStorage) fileStorageLocator.getDefault();
fileStorage.saveStream(path, inputStream);
Do you have any thoughts on this. Thanks
Did you define a bean for your new class?
Like this:
@Bean
@Primary
CustomAwsFileStorage customAwsFileStorage() {
return new MyLocalFileStorage("custom_s3");
}
You should also have to set this property:
jmix.core.default-file-storage = custom_s3