web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Post excel file on SP ...
Power Automate
Unanswered

Post excel file on SP using http

(0) ShareShare
ReportReport
Posted on by 26

Hi, I am running into an issue when posting an xlsm file on SP using http. I want to use bypass-shared-lock not available using the "create file"

The problem I am getting is after creating the file if I open it, excel online tries to open it and complains "We're sorry we couldn't open your workbook. It's possibly corrupt or using a file format that's not supported"

The Flow I have is very simple

  1. Get file content on OneDrive for business
  2. Sent http request
    1. Site Address - Using pulled down
    2. Method - Post
    3. Uri _api/web/GetFolderByServerRelativeUrl('Shared Documents/General')/Files/add(url='sample.xlsm',overwrite=true)
    4. Headers
      1. Prefer: bypass-shared-lock
      2. X-RequestDigest: {form_digest_value}
      3. Content-Type: application/octet-stream
      4. Accept: application/json;odata=verbose
    5. Body: [Dynamic content: File content from onedrive get file]

The file gets created with no error but fails when opening with the error noted. I also tried entering some json code found online on the body but get same result

 

Appreciate any assistance on working this

 

 

Categories:
I have the same question (0)
  • SudeepGhatakNZ Profile Picture
    14,394 Most Valuable Professional on at

    Did you perform a Base64toBinary conversion?

    SudeepGhatakNZ_0-1693181253873.png

     

  • garce Profile Picture
    26 on at

    No, I didn't because I am reading from OneDrive I assume the file would be in binary and I would need to convert to base64 (reverse direction)??

    That didn't work either

    I don't understand your two steps above. Isn't the post suficiente ?

     

  • SudeepGhatakNZ Profile Picture
    14,394 Most Valuable Professional on at

    I dont think the issue is with your HTTP action, I can create a text file using just the basic headers. Excel requires a specific content type, probably that's what is causing the issue

    SudeepGhatakNZ_0-1693197243351.png

    SudeepGhatakNZ_1-1693197295074.png

     

    However, the GRAPH API looks promising.

    Working with Excel in Microsoft Graph - Microsoft Graph v1.0 | Microsoft Learn

     

    I'll let you know when I get this working with Excel

     

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Leaderboard > Power Automate

#1
trice602 Profile Picture

trice602 398 Super User 2025 Season 2

#2
David_MA Profile Picture

David_MA 323 Super User 2025 Season 2

#3
Expiscornovus Profile Picture

Expiscornovus 183 Most Valuable Professional

Last 30 days Overall leaderboard