Browse Source

Even more debug log

master
Daniel Gyulai 4 years ago
parent
commit
3bb8fdcfae
  1. 7
      CoviDok/BLL/Storage/StorageHandler.cs
  2. 3
      CoviDok/Controllers/ImagesController.cs

7
CoviDok/BLL/Storage/StorageHandler.cs

@ -23,11 +23,18 @@ namespace CoviDok.BLL.Storage
{ {
try try
{ {
Console.WriteLine("StorageHandler:UploadImage - checking bucket " + BucketName);
// Make a bucket on the server, if not already present. // Make a bucket on the server, if not already present.
bool found = await storageProvider.NamespaceExists(BucketName); bool found = await storageProvider.NamespaceExists(BucketName);
if (!found) if (!found)
{ {
Console.WriteLine("StorageHandler:UploadImage - " + BucketName + " not found, creating" );
await storageProvider.CreateNamespace(BucketName); 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. // Upload a file to bucket.
Console.WriteLine("StorageHandler:UploadImage - Uploading " + ObjectName); Console.WriteLine("StorageHandler:UploadImage - Uploading " + ObjectName);

3
CoviDok/Controllers/ImagesController.cs

@ -45,8 +45,9 @@ namespace CoviDok.Controllers
try try
{ {
Session s = await Handler.GetSession(post.SessionId); 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(); 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); StorageResult Result = await MinioHandler.UploadImage(BucketName, MakeStream(post.File), post.File.Length, id);
Console.WriteLine("ImagesController:OnPostImage - Request successful, uploaded " + id); Console.WriteLine("ImagesController:OnPostImage - Request successful, uploaded " + id);
if (!Result.Success) response.Status = Status.Error; if (!Result.Success) response.Status = Status.Error;

Loading…
Cancel
Save