Downloading files from S3 plugin and using it

Hello, i’m using the AWS S3 Storage plugin from the latest orthanc.

But when I try to manually download files from the bucket and upload it in another Orthanc or just use dcmdump to see the files content, i got errors.

csvmigrator-1  | Downloading file: s3://jpc-test-bucket/6ad603a2-7be5-4351-b88f-5116b9fdb3e3.dcm
csvmigrator-1  | Uploading file to Orthanc...
orthanc-1      | I0612 14:28:57.195479 HttpServer.cpp:1262] (http) POST /instances
orthanc-1      | I0612 14:28:57.195688 OrthancRestApi.cpp:163] (http) Receiving a DICOM file of 233826 bytes through HTTP
orthanc-1      | W: DcmItem: Length of element (9c78,77c4) is odd
orthanc-1      | E: DcmElement: Unknown Tag & Data (9c78,77c4) larger (3449575541) than remaining bytes (233810) in file, premature end of stream
orthanc-1      | E0612 14:28:57.196145 OrthancException.cpp:61] Bad file format: Cannot parse an invalid DICOM file (size: 233826 bytes)
❯ dcmdump 0cf7c239-a54d-4808-a09d-c120f9fe9e07.dcm
W: DcmItem: Length of element (9c78,77c4) is odd
E: DcmElement: Unknown Tag & Data (9c78,77c4) larger (3449575541) than remaining bytes in file
W: DcmItem: Dataset not in ascending tag order, at element (9c78,77c4)
E: dcmdump: I/O suspension or premature end of stream: reading file: 0cf7c239-a54d-4808-a09d-c120f9fe9e07.dcm

Hi,

It seems you have enabled StorageCompression so the files are compressed. You must then use OrthancRecoverCompressedFile to uncompress them. You can download it from here.

The most generic way to retrieve a file is to use the Orthanc Rest API http://localhost:8042/instance/{id}/file

HTH,

Alain

1 Like

Hi Alain,

I got it! Thanks for the help!

João