我正在使用以下代码将文件上传到 S3 存储桶:
//upload code start
AWSCredentials credential = new BasicAWSCredentials(AppConstants.AWS_ACCESS_KEY_ID, AppConstants.AWS_SECRET_ACCESS_ID);
TransferManager manager = new TransferManager(credential);
// Transfer a file to an S3 bucket.
Upload upload = manager.upload("bucket_name", AppConstants.AWS_ACCESS_KEY_ID, file);
while (!upload.isDone()) {
Thread.sleep(200);
}
//upload code end
我想将其放入存储桶内名为“android_uploads”的目录中,但传输管理器正在将所有文件上传到存储桶的根目录。
知道我怎么能做到这一点吗?