Skip to main content
Participant
July 18, 2022
Question

Unreadable Content Docx Error Message

  • July 18, 2022
  • 1 reply
  • 1156 views

Hi, testing out this API for generating docx files but I am encountering the following error when attempting to open the generated files:

When I click yes and recover the contents, the document seems to be generated correctly.

Any advice on how to resolve this error message?

 

    This topic has been closed for replies.

    1 reply

    Raymond Camden
    Community Manager
    Community Manager
    July 18, 2022

    If you are using the REST API, remember that the result is a multipart form response you need to parse to get the binary data of your file. 

    Participant
    July 18, 2022

    Hi Raymond - I've been parsing that to get what I believe is the raw file data:

    I interpret the raw file data as starting after the 'name="multipartLabel" ' string of text, and ending at the next boundary identifier:

     

    Is there any best practice or code examples for converting the raw string into a docx file?

     

    Raymond Camden
    Community Manager
    Community Manager
    July 18, 2022

    Well, it (Multpart Form Response) is a spec you can read to get the _exact_ rules on parsing. I'd say Google for that and the platform of your choice. So for example, if you are on PHP, google for "php multipart form response".