Troubleshooting upload files failure

Hi,

I have a problem with uploading DICOM files with the “/instances” API.
When posted from Postman everything works well.
When posted used from my own code, I get a response 200, but not response content and no actual effect (file is not really uploaded).
I am trying to debug the issue, and would like to know if there is a way to understand what is being received/happening on the Orthanc side.
I am using Orthanc in docker.
turning on --verbose does not produce any logging for rest API calls.

Is there a way to enable such logging?

The code I am using for the upload is:

internal async Task<Dictionary<string, bool>> UploadToLocalPacs(List files)
{
var filesResultStatus = new Dictionary<string, bool>();
using (var client = new HttpClient())
{
foreach (var file in files)
{
filesResultStatus[file.FileName] = false; // by default - not saved unless successful
try
{
if (file.Length > 0)
{
using (var content = new MultipartFormDataContent())
{
content.Add(new StreamContent(file.OpenReadStream())
{
Headers =
{
ContentLength = file.Length,
ContentType = new MediaTypeHeaderValue(file.ContentType),
},
}, “File”, file.FileName);
var result = await client.PostAsync(OrthancClient.BaseUrl + “/instances”, content);
var resultContent = await result.Content.ReadAsStringAsync();

if (result.StatusCode == System.Net.HttpStatusCode.OK)
{
filesResultStatus[file.FileName] = true;
}
else
{
_log.Warning(“UploadToLocalPacs: files uploading file: ‘{}’”, content);
}
}
}
}
catch (Exception ex)
{
_log.Error(ex, “UploadToLocalPacs: Error uploading file”);
}
}
}

return filesResultStatus;

Thank you very much!
Gil

When in verbose mode, uploading a file through the web interface shall give you this kind of logs:

I0401 22:23:39.694780 HttpServer.cpp:788] POST /instances
I0401 22:23:39.710411 OrthancRestApi.cpp:118] Receiving a DICOM file of 58856 bytes through HTTP
I0401 22:23:39.726024 FilesystemStorage.cpp:118] Creating attachment “de40bc42-4387-487d-81a4-92180d13aec8” of “DICOM” type (size: 1MB)
I0401 22:23:39.757267 FilesystemStorage.cpp:118] Creating attachment “98da07d2-4866-4231-a177-a23a8c66dfe7” of “JSON summary of DICOM” type (size: 1MB)
I0401 22:23:39.772888 ServerContext.cpp:417] New instance stored

You should get the same kind of logs when using the Rest API through Postman and then, using your code too.