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

Announcements

News and Announcements icon
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

I have the same question (0)
  • Verified answer
    Emre GULCAN Profile Picture
    2,379 on at

    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)

  • Community Member Profile Picture
    on at

    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.

  • Emre GULCAN Profile Picture
    2,379 on at

    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.

  • 00037FFE470C2A4A Profile Picture
    5 on at

    Hello Kfranck

    Could you please share your solution,

    I face this issue.

    Thank you in advance.

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

Season of Sharing Community Challenge Launch!

Jump in, show your community spirit, and win prizes!

Women in Power Builds Momentum

Expanding mentorship, skilling, and AI innovation

Congratulations to the May Top 10 Community Leaders

These are the community rock stars!

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans