Skip to main content

Notifications

Power Apps - Microsoft Dataverse
Suggested answer

Blank page when downloading a file from Dataverse

Like (1) ShareShare
ReportReport
Posted on 3 Oct 2024 17:24:26 by 2,270
My app is allowing users to download files from Dataverse.
 
It works well when the user is signed into what I believe is CRM dynamics, but when is not, the download opens a blank page.
 
Example: with this URL:
 
https://mydomain.crm4.dynamics.com/api/data/v9.2/pg_attachmtoses(fdfdsfae)/pg_anexo/$value
 
If the user opens https://mydomain.crm4.dynamics.com/ and signs in, he's able to download the files, but if the login cookie isn't present in the browser, he gets a blank page.
 
Is there a way to get around this?
 
Any help?
 
Thanks in advance!
 
 
  • WebPortal Profile Picture
    WebPortal 2,270 on 11 Oct 2024 at 12:10:56
    Blank page when downloading a file from Dataverse
    Hello all,
     
    Thanks for your support with this matter, it is becoming an important issue for multiple apps I've developed.
    If anyone is aware of more detailed documentation for a solution, I'd really appreciate.
     
    Thank you!
  • MichaelFP Profile Picture
    MichaelFP 1,525 on 07 Oct 2024 at 13:00:01
    Blank page when downloading a file from Dataverse
    Create a power automate that you can call by HTTP request of type get. 
     
    Retrieve the file and response with the file. 
  • Shashank Bhide Profile Picture
    Shashank Bhide 931 on 06 Oct 2024 at 12:46:22
    Blank page when downloading a file from Dataverse
    no easy solution if you don't have a developer on your side who knows how to connect to Dataverse using C# or power automate, one way is to create a function app/power automate which connects to Dataverse and downloads the file using the path you mentioned then streams that file's binary data over HTTP as response and your client browser will receive it as a downloaded file. 
  • Suggested answer
    MichaelFP Profile Picture
    MichaelFP 1,525 on 03 Oct 2024 at 19:57:47
    Blank page when downloading a file from Dataverse
    you are providing the URL as a link do download the file? If you are doing that it will always not work if the user is not logged in in the system.
     
    "https://mydomain.crm4.dynamics.com/api/data/v9.2"  it is a webapi that is required to be authenticated to make the request. So the user will always be authenticated to be able to retrieve. if your are not logged in you must send the OAuth authentication before do the request.
     
    This is not like a file inside a folder on a hosted website. that you just click and will return the binary. if you want to some similar i would recommend to user Azure Blog Storage for that.
     
     
    If my answer helped you, please give me a thumbs up (👍). If solve your question please mark as answer ✔️. This is help the community.

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

November 2024 Newsletter…

November 2024 Community Newsletter…

Community Update Oct 28…

Power Platform Community Update…

Tuesday Tip #9 Get Recognized…

Welcome to a brand new series, Tuesday Tips…

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 144,316

#2
RandyHayes Profile Picture

RandyHayes 76,308

#3
Pstork1 Profile Picture

Pstork1 64,290

Leaderboard

Featured topics