diff --git a/CoviDok/BLL/Storage/StorageHandler.cs b/CoviDok/BLL/Storage/StorageHandler.cs index 6fb387e..76c3531 100644 --- a/CoviDok/BLL/Storage/StorageHandler.cs +++ b/CoviDok/BLL/Storage/StorageHandler.cs @@ -23,11 +23,18 @@ namespace CoviDok.BLL.Storage { try { + Console.WriteLine("StorageHandler:UploadImage - checking bucket " + BucketName); // Make a bucket on the server, if not already present. bool found = await storageProvider.NamespaceExists(BucketName); if (!found) { + Console.WriteLine("StorageHandler:UploadImage - " + BucketName + " not found, creating" ); await storageProvider.CreateNamespace(BucketName); + Console.WriteLine("StorageHandler:UploadImage - Created " + BucketName); + } + else + { + Console.WriteLine("StorageHandler:UploadImage - Target " + BucketName + " already exists on server"); } // Upload a file to bucket. Console.WriteLine("StorageHandler:UploadImage - Uploading " + ObjectName); diff --git a/CoviDok/Controllers/ImagesController.cs b/CoviDok/Controllers/ImagesController.cs index 295e77e..bcca81d 100644 --- a/CoviDok/Controllers/ImagesController.cs +++ b/CoviDok/Controllers/ImagesController.cs @@ -45,8 +45,9 @@ namespace CoviDok.Controllers try { Session s = await Handler.GetSession(post.SessionId); - Console.WriteLine("ImagesController:OnPostImage - Incoming request, ID: " + post.SessionId + ", payload: " + post.File.Length); + Console.WriteLine("ImagesController:OnPostImage - Incoming request, SessionID: " + post.SessionId + ", payload: " + post.File.Length); string id = Cuid.Generate(); + Console.WriteLine("ImagesController:OnPostImage - Incoming request, Uploaded image of " + post.SessionId + " will be " + id); StorageResult Result = await MinioHandler.UploadImage(BucketName, MakeStream(post.File), post.File.Length, id); Console.WriteLine("ImagesController:OnPostImage - Request successful, uploaded " + id); if (!Result.Success) response.Status = Status.Error;