Home > Forum > Actions > REST GET binary - Error "Total size must be greater than zero

REST GET binary - Error "Total size must be greater than zero
0

Hi,
I have simple Invoke Rest Action, which should download a file (pdf).

I get this error:

Validation error: Invoke REST Web service - Request Url:
https://myhost.com/v1/dms-archive/v1/Kundenakt/documents/4711-abcd-1234/contents/0
Response Code:
Exceptions:
Total size must be greater than zero

* Same call in Postman downloads the file correct
* If I change the content type in the action from "binary" to json, I get correct response-code 200 and the binary as text in a multiline-field

Other REST-downloads (other endpoints) are working as expected.

Any ideas?

MVP

Hi Ernst,

I would start with inspecting the request WEBCON executes and compare it to the one postman submits. I use HttpToolkit in these cases.

Regardless, if you already have an option to get the content, you could use the add attachment action to generate to binary data for the attachment.
When attachments are to be created when executing the action, the query must return columns FileName and Content, containing the attachment’s name and byte content. The query may also return a Description column if required.
https://docs.webcon.com/docs/2026R1/Studio/Action/Attachments/Action_AddAttachment
SELECT convert(image,'0x') AS Content, 'file1.txt' AS FileName

Best regards,
Daniel