Skip to main content

Notifications

Announcements

No record found.

Service | Customer Service, Contact Center, Fie...
Suggested answer

HTML is not displaying attachment properly

Posted on by 10

Hello,

I have one custom ribbon button which displays the html page with all related attachments.

In click of one view button the attachment displays in IFrame. but for some of the images its not displaying.

I have refer the below link for this process.
https://mahadeomatre.blogspot.com/2016/10/view-or-download-attachments-for.html

Can any one help me with the same?

Any help would be appreciated. 

  • cloflyMao Profile Picture
    cloflyMao 25,198 on at
    RE: HTML is not displaying attachment properly

    Hi Jalak,

    Have you solved the issue successfully?

    Regards,

    Clofly

  • Suggested answer
    cloflyMao Profile Picture
    cloflyMao 25,198 on at
    RE: HTML is not displaying attachment properly

    Hi Jalak,

    Please check whether base64 string is valid by copying all text in src property of img with inspector.

    https://jaredwinick.github.io/base64-image-viewer/

    https://base64.guru/converter/decode/image

    In addition, you could also try those custom controls to display image attachments.

    https://pcf.gallery/gallery-control/

    https://pcf.gallery/attachment-gallery/

    Regards,

    Clofly

  • Pankaj Gogoi Profile Picture
    Pankaj Gogoi 3,177 on at
    RE: HTML is not displaying attachment properly

    Hi Jalak,

    Can you put a breakpoint in showdata function and get the url and copy it to a separate window and see if it loads.

    Check if there is a cross domain issue with failed attachements. Also check if it is a permission issue.

    Hope this helps.

    Best Regards

    PG

  • Jalak Profile Picture
    Jalak 10 on at
    RE: HTML is not displaying attachment properly

    No its not browser specific issue. I used openWebResource method only.

    After opening it, for some attachment its working fine and for some its not loading in IFrame.

  • Pankaj Gogoi Profile Picture
    Pankaj Gogoi 3,177 on at
    RE: HTML is not displaying attachment properly

    Hi Jalak,

    Is it happening with specific browser? Check the console if it is logging any error and also check the network tab for the images path that you are trying to load.

    Can you try using the openWebResource method?

    docs.microsoft.com/.../openwebresource

    Best Regards

    PG

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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,269 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,198 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans