Why multi part request body PDF document is failing in my Integration (extension changed)

Certified Senior Developer

Hi,

I've created an Integration component and I have a PDF to send to a remote REST API (by POST method).

So I've created an Appian document, and I've upload a PDF file (Test1.pdf) as it.

When I call the remote API, I get an error in the response : "developerMessage : Extension non authorized - filename: "Test1.pdf.zip"  "

Do you know why this component is adding ".zip" extension to the PDF file ?

Of course, I've tested it before in Postman and all works fine.

In my request body (in Appian), I've set my param like this :

Name : "document"  

Content Type : Document (auto-detect)

Value : (RI is uploaded with Test1.pdf)

I've tried another way : Content Type = Custom (with  application/pdf) but I obtain another error : "Internal error: Required request part 'document' is not present"

Any idea ?

  Discussion posts and replies are publicly visible

Parents
  • 0
    Certified Lead Developer

    Did you check the outgoing headers in the HTTP request? Do they include any hint on the ZIP document type or file name?

  • 0
    Certified Senior Developer
    in reply to Stefan Helzle

    I've just saw the encoding field (gzip), but not any Zip document type for the requested param :

    POST /my-ws/rest/v1/documents/upload HTTP/1.1
    Content-Type: multipart/form-data; boundary=TnQmfygKfP801A_kE1bGL-7YAFk_k6gl9
    Content-Length: 36084
    Host: my-host.fr
    Connection: Keep-Alive
    User-Agent: Appian
    Accept-Encoding: gzip,deflate

    --TnQmfygKfP801A_kE1bGL-7YAFk_k6gl9
    Content-Disposition: form-data; name="document"; filename="Test1.pdf"
    Content-Type: application/pdf
    Content-Transfer-Encoding: binary

    Binary content not shown for document, Test1.pdf (33.94 KB).

    --TnQmfygKfP801A_kE1bGL-7YAFk_k6gl9
    Content-Disposition: form-data; name="comment"
    Content-Type: text/plain; charset=UTF-8
    Content-Transfer-Encoding: 8bit
    test 1

    --TnQmfygKfP801A_kE1bGL-7YAFk_k6gl9
    Content-Disposition: form-data; name="label"
    Content-Type: text/plain; charset=UTF-8
    Content-Transfer-Encoding: 8bit
    SAS1

    --TnQmfygKfP801A_kE1bGL-7YAFk_k6gl9
    Content-Disposition: form-data; name="meta"; filename="Test1.xml"
    Content-Type: application/xml
    Content-Transfer-Encoding: binary

    Binary content not shown for document, Test1.xml (< 1 KB).

    --TnQmfygKfP801A_kE1bGL-7YAFk_k6gl9--

  • +1
    Certified Lead Developer
    in reply to cedric01

    This looks good to me. I am not sure about the PDF format. I assume this also uses some kind of compression. If this other system now checks the binary content for a ZIP signature, this might lead to issues. But this is just guessing !?!

  • 0
    Certified Senior Developer
    in reply to Stefan Helzle

    Thank you Stefan, but in this case why I don't have the same issue in Postman ?

Reply Children