diff --git a/IRaCIS.Core.API/appsettings.Test_IRC.json b/IRaCIS.Core.API/appsettings.Test_IRC.json index edad727d5..2ab92a091 100644 --- a/IRaCIS.Core.API/appsettings.Test_IRC.json +++ b/IRaCIS.Core.API/appsettings.Test_IRC.json @@ -28,7 +28,7 @@ }, "MinIO": { - "endpoint": "http://192.168.3.68", + "endpoint": "192.168.3.68", "port": "8001", "useSSL": false, "accessKey": "IDFkwEpWej0b4DtiuThL", diff --git a/IRaCIS.Core.Application/TestService.cs b/IRaCIS.Core.Application/TestService.cs index 424bceafb..156f0d6b2 100644 --- a/IRaCIS.Core.Application/TestService.cs +++ b/IRaCIS.Core.Application/TestService.cs @@ -17,11 +17,14 @@ using Microsoft.Extensions.Logging; using Microsoft.Extensions.Options; using MiniExcelLibs; using Minio; +using Minio.DataModel.Args; using NPOI.HPSF; using NPOI.POIFS.Crypt; +using SharpCompress.Common; using Spire.Doc; using System.Linq.Expressions; using System.Reflection.Metadata; +using System.Security.AccessControl; using System.Security.Cryptography; using System.Text; using System.Text.RegularExpressions; @@ -166,12 +169,16 @@ namespace IRaCIS.Application.Services var minioClient = new MinioClient().WithEndpoint($"{minIO.endpoint}:{minIO.port}") - .WithCredentials(minIO.accessKey, minIO.secretKey) + .WithCredentials(minIO.accessKey, minIO.secretKey).WithSSL(false) .Build(); + var putObjectArgs = new PutObjectArgs() + .WithBucket(minIO.bucketName) + .WithObject("myfolder/test.txt") + .WithFileName("C:\\Users\\Administrator\\Desktop\\TrialSiteUserImportTemplate.xlsx"); + await minioClient.PutObjectAsync(putObjectArgs); - //ResponseOutput.Ok(options) return await Task.FromResult(ResponseOutput.Ok(options)); }