add get upload url

This commit is contained in:
2021-09-29 02:37:14 +08:00
parent ef3f1bfa88
commit 18d2dfb86e
+13
View File
@@ -55,6 +55,19 @@ namespace SimApi.Helpers
}
}
public string GetUploadUrl(string path, int expire = 7200)
{
try
{
return Mc.PresignedPutObjectAsync(Bucket, path, expire).Result;
}
catch (MinioException e)
{
Console.WriteLine("Error occurred: " + e);
return e.Message;
}
}
public string UploadFile(string path, Stream stream)
{
try