• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers

Unreadable Content Docx Error Message

New Here ,
Jul 18, 2022 Jul 18, 2022

Copy link to clipboard

Copied

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

Nicholas25266909k6av_1-1658151996202.png

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

Any advice on how to resolve this error message?

 

Views

82

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Employee ,
Jul 18, 2022 Jul 18, 2022

Copy link to clipboard

Copied

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. 

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jul 18, 2022 Jul 18, 2022

Copy link to clipboard

Copied

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:

Nicholas25266909k6av_0-1658179190467.png

Nicholas25266909k6av_1-1658179327387.png

 

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

 

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Employee ,
Jul 18, 2022 Jul 18, 2022

Copy link to clipboard

Copied

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". 

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jul 19, 2022 Jul 19, 2022

Copy link to clipboard

Copied

Thanks Raymond - I'm using Xano, which is a no-code development platform. I believe I am parsing the multipart correctly to obtain the raw word doc data - issue might be with the way the platform creates the docx using the raw data. What's the usual process for saving the raw data to a file? For example, how would I go about creating the docx file in a language like Python? Thanks.

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Employee ,
Jul 19, 2022 Jul 19, 2022

Copy link to clipboard

Copied

LATEST

Um, so I don't know the code to parse multipart in Python. It _should_ just be binary data that you save. Once you get the binary part I mean.

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources