feature: Optional OCR-Assisted Draft Pre-Fill
This commit is contained in:
@@ -58,6 +58,18 @@ public class DocumentStorageService : IDocumentStorageService
|
||||
.WithExpiry(_options.PresignedUrlExpiryMinutes * 60));
|
||||
}
|
||||
|
||||
public async Task<Stream> DownloadAsync(string objectKey)
|
||||
{
|
||||
var memStream = new MemoryStream();
|
||||
await _minio.GetObjectAsync(new GetObjectArgs()
|
||||
.WithBucket(_options.BucketName)
|
||||
.WithObject(objectKey)
|
||||
.WithCallbackStream(stream => stream.CopyTo(memStream)));
|
||||
|
||||
memStream.Position = 0;
|
||||
return memStream;
|
||||
}
|
||||
|
||||
private async Task EnsureBucketAsync()
|
||||
{
|
||||
var exists = await _minio.BucketExistsAsync(new BucketExistsArgs().WithBucket(_options.BucketName));
|
||||
|
||||
Reference in New Issue
Block a user