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

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Customer experience | Sales, Customer Insights,...
Unanswered

Send body from OneDrive PDF file to JavaScript Resource and then download it

(0) ShareShare
ReportReport
Posted on by 15

Here is the thing,

I have a WebResource connected to a Ribbon Button that calls a flow. 

The Flow gets a Word Template from my OneDrive, converts it to PDF(Preview) and sends it back to the Javascript Web Resource using HTTP Response.

The document is then downloaded, but when I open it, it says "We can't open this file".

Here is the Flow Response:

And here is the code that is used to fetch the response and download it:

function downloadFile(blob, fileName) {
        debugger;
        if (navigator.msSaveBlob) { // IE 10 
            navigator.msSaveBlob(blob, fileName);
        } else {
            var link = document.createElement("a");
            if (link.download !== undefined) {
                var url = URL.createObjectURL(blob);
                link.setAttribute("href", url);
                link.setAttribute("download", fileName);
                link.style.visibility = 'hidden';
                document.body.appendChild(link);
                link.click();
                document.body.removeChild(link);
            }
        }
    }

The entire code is pretty much a copy paste of this with a few changes:

https://www.itaintboring.com/powerapps/how-to-add-a-ribbon-button-that-calls-a-power-automate-flow/

I suspect it is something to do with the Content-Type, or the fact that the file is Converted(Preview) and not Saved to OneDrive.

I have the same question (0)

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Congratulations to our 2025 Community Spotlights

Thanks to all of our 2025 Community Spotlight stars!

Leaderboard > Customer experience | Sales, Customer Insights, CRM

#1
ManoVerse Profile Picture

ManoVerse 180 Super User 2026 Season 1

#2
11manish Profile Picture

11manish 123

#3
CU11031447-0 Profile Picture

CU11031447-0 100

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans