summary คิวรี่เครื่องราช
This commit is contained in:
parent
561ef617b6
commit
52ab6ee6f7
8 changed files with 208 additions and 8 deletions
|
|
@ -213,6 +213,28 @@ namespace BMA.EHR.Application.Repositories
|
|||
return path;
|
||||
}
|
||||
|
||||
public async Task<string> ImagesPathByName(string fileName)
|
||||
{
|
||||
var config = new AmazonS3Config
|
||||
{
|
||||
ServiceURL = _configuration["MinIO:Endpoint"],
|
||||
ForcePathStyle = true
|
||||
};
|
||||
|
||||
DateTime expires = DateTime.UtcNow.AddHours(6);
|
||||
var _protocol = _configuration["Protocol"];
|
||||
GetPreSignedUrlRequest request = new GetPreSignedUrlRequest
|
||||
{
|
||||
BucketName = _bucketName,
|
||||
Key = fileName,
|
||||
Expires = expires,
|
||||
Protocol = _protocol == "HTTPS" ? Protocol.HTTPS : Protocol.HTTP
|
||||
};
|
||||
string path = _s3Client.GetPreSignedURL(request);
|
||||
|
||||
return path;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
public List<Guid> GetAllIdByRoot(Guid? id)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue