Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

Need to return file from a custom action

(1) ShareShare
ReportReport
Posted on by

Hi,

I currently face a weird request. I want to add a button to download files from an external REST API. For some specific reasons I must not calls the service from client side. So I'm trying to use an Plugin registered on a custom action and then call the custom action in JavaScript web resource. My question is how to return a binary from custom action? Did any one face the same need and can help me?

May be my approach isn't the best. Any proposal will be welcome.

*This post is locked for comments

  • 00037FFE470C2A4A Profile Picture
    5 on at
    RE: Need to return file from a custom action

    Hello Kfranck

    Could you please share your solution,

    I face this issue.

    Thank you in advance.

  • Emre GULCAN Profile Picture
    2,379 on at
    RE: Need to return file from a custom action

    Hi,

    I'm happy to hear that.

    If it's not private can you share your code for future questions? maybe someone will have same question like you.

  • Community Member Profile Picture
    on at
    RE: Need to return file from a custom action

    Emre,

    Your solution fits well what I need. I try it with FileSaver.js, and I can download my files.

    Thank you for your help.

  • Verified answer
    Emre GULCAN Profile Picture
    2,379 on at
    RE: Need to return file from a custom action

    Hi,

    I think you should convert your file to Base64 and return as "string" output parameter from custom action.

    At clientside, you can use FileSaver.js (github.com/.../FileSaver.js)

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

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

🌸 Community Spring Festival 2025 Challenge Winners! 🌸

Congratulations to all our community participants!

Adis Hodzic – Community Spotlight

We are honored to recognize Adis Hodzic as our May 2025 Community…

Leaderboard > Microsoft Dynamics CRM (Archived)

#1
Mohamed Amine Mahmoudi Profile Picture

Mohamed Amine Mahmoudi 83 Super User 2025 Season 1

#2
Community Member Profile Picture

Community Member 54

#3
Victor Onyebuchi Profile Picture

Victor Onyebuchi 6

Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans