Share via

How to avoid corrupt Word-Docs by using the HTTP-Sharepoint Request in Powerautomate

Nix, Norbert, RNG-TGP 0 Reputation points
2026-03-17T13:18:55.0666667+00:00

Hallo,

i have a issue using the powerautomat HTTP-Request for SharePoint during send a Word-Doc, created in a previous step by using Populate a Word Document. If i use "Create file" i will find the created doc uncorrupted in my Sharepoint. Using the HTTP-Request, Word will not able to open this doc. The doc will be send to my Sharpoint as well, but i cant open it.

Here are my Settings.

User's image

The text property is: body('DokumentErstellen'). I set this by using the dynamic content. I tried a lot of Header settings, and binary coverts. The "Create File" Premium action works well with the same output of "Dokument erstellen". Some idea whats wrong? thx for help

I tried also to the text property to outputs('Dokumenterstellen')?['body'])

outputs(body('DokumentErstellen')?['body'])
Microsoft 365 and Office | SharePoint | Development
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. Jayden-P 17,875 Reputation points Microsoft External Staff Moderator
    2026-03-17T14:52:58.2033333+00:00

    Please note that our forum is a public platform, and we will modify your question to hide your personal information in the description. Kindly ensure that you hide any personal or organizational information the next time you post an error or other details to protect personal data.

    Hi Nix, Norbert, RNG-TGP

    Please note that we have a dedicated forum for Power Automate flows. You can also consider posting in that forum to get more useful information from experts in that field.

    Microsoft Power Platform Community Forum Thread

    I also tried to reproduce your case and encounter the same behavior for Word documents. The HTTP call only worked for txt file on my side. (I tested with docx and xlsx extensions, but the result is the same, only txt worked).Can you try to change it to txt extension to confirm this behavior?

    User's image

    Please try reaching out via the Power Automate forum to get better assistance. I apologize for redirecting you to another forum.

    If you ever know any insights that is helpful, please share here so I can learn from you,

    Thanks for your understanding.


    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    1 person found this answer helpful.

  2. Q&A Assist
    2026-03-17T13:19:17.2066667+00:00
    AI generated content. This question contains an answer created with AI from Q&A Assist. Learn more

    The Word document becomes corrupt because the HTTP action is not sending the file content in the correct binary format, even though the same content works with the “Create file” action.

    To avoid corruption when using the SharePoint HTTP request:

    1. Ensure the body of the HTTP request is the raw file content (binary), not JSON or text. In Power Automate this usually means:
      • Use the Outputs of the “Populate a Word document” (or the file content property) directly in the HTTP body.
      • Do not wrap it in JSON or convert it to string.
    2. Set the Content-Type header to a binary media type that matches the file:
      • Content-Type: application/octet-stream
    3. Confirm the SharePoint REST endpoint is the file upload endpoint that accepts binary content in the request body, for example:
      • .../GetFolderByServerRelativeUrl('/sites/.../Library')/Files/add(url='filename.docx',overwrite=true)
    4. If the file still opens as corrupt, download it from the library and compare its size with the file created by the “Create file” action. A smaller or larger size indicates the HTTP action is altering the content (for example, encoding as text). In that case, reconfigure the HTTP body to use the file content output exactly as provided by the document-generation step.

    If a file that previously opened correctly now fails to open, treat it as potentially corrupt and download it from SharePoint, then attempt repair using the Office repair guidance. Corrupt files can prevent SharePoint documents from opening correctly.


    References:

    0 comments No comments

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.