Zum Hauptinhalt springen
Echtzeit-Radar & Feeds
Alle RSS Feeds ➔
👥 Community & Social
••
Sichere ProgrammierungHow Hindsight Turned Deployment #1017 Into the Fix for #1057(29.09.2026 um 06:25 Uhr)
••
Sichere ProgrammierungSystems foundations should start below the framework(29.09.2026 um 06:30 Uhr)
••
Sichere ProgrammierungHow a game should say no: designing refusals people can act on(29.09.2026 um 06:30 Uhr)
••
Sichere ProgrammierungTuring Sim: Making the USD Schemas Inspector Readable(29.09.2026 um 06:31 Uhr)
••••
Sichere ProgrammierungHow Hindsight Turned Deployment #1017 Into the Fix for #1057(29.09.2026 um 06:25 Uhr)
••
Sichere ProgrammierungSystems foundations should start below the framework(29.09.2026 um 06:30 Uhr)
••
Sichere ProgrammierungHow a game should say no: designing refusals people can act on(29.09.2026 um 06:30 Uhr)
••
Sichere ProgrammierungTuring Sim: Making the USD Schemas Inspector Readable(29.09.2026 um 06:31 Uhr)
••
Intelligence View
⚡ tsecurity.de Intelligence

Building a Canvas App PCF Control to Download Files from SharePoint

This post will cover how to enable file downloads from SharePoint within a Power Apps (Canvas App) via a PCF component - without granting users direct access to the underlying SharePoint location. The goal is to allow users to trigger the…

0
↗ Quelle (dev.to)
Reagiere als Erste:r — dein Feedback zählt!

This post will cover how to enable file downloads from SharePoint within a Power Apps (Canvas App) via a PCF component - without granting users direct access to the underlying SharePoint location. The goal is to allow users to trigger the download of a specific file (generated by an external process) to their local machine via a single button click.



PCF component enabling file download






Prerequisites




  • Visual Studio Code

  • Node.js

  • Microsoft Power Platform CLI

  • .NET

  • PCF components enabled for Canvas Apps in your environment






Solution Overview



This solution includes:




  • A PCF control for handling the file download


  • A Power Automate flow to retrieve and convert SharePoint files to Base64


  • A Canvas App that ties everything together




This post will show how to download files stored in SharePoint:

Files stored in SharePoint location



…directly from this Canvas App:

PCF component enabling file download






1 PCF Component: File Downloader




You can download the PCF solution here: Solutions.zip on GitHub




The PCF control handles the actual file download within the Canvas App. It takes file metadata and content as input and triggers a download on the user's device without exposing the SharePoint source.



There are two main files that define the component, the manifest (ControlManifest.Input.xml) and the implementation logic (index.ts).



The manifest file ControlManifest.Input.xml defines four properties passed in from Power Apps:





  1. fileName - The name users will see when the file is downloaded.


  2. fileMIMEType - The MIME type used to correctly format the file.


  3. fileBase64 - The file’s content encoded in Base64.


  4. fileDownload - A boolean flag that triggers the download.



ControlManifest.Input.xml



The index.ts file contains the component logic:



The UpdateView() method listens for changes in the control's context and initiates a file download if the fileDownload flag is set to true. It creates a temporary a element with the file data, triggers the download, and then signals the framework to reset the flag to avoid repeated downloads.



UpdateView method



The getOutputs() method resets fileDownload to false to ensure the download only occurs once per trigger.



getOutputs method






2 Power Automate Flow: Convert SharePoint File to Base64



A Power Automate Flow that takes the name of a file in a SharePoint location (passed through from a Canvas App) and returns the file MIMEType and the file as base64.



The MIMEtype of the file is obtained via body('Get_file_content_using_path')?['$content-type']

The file as base64 is obtained via outputs('Get_file_content_using_path')?['body']?['$content']



Power Automate Flow






3 Canvas App: Integration



Steps to connect it all up in your Canvas App:




  1. Import the PCF component into your environment as a solution:


  2. In Power Apps, go to Insert > Code components, and add the control to your screen:

    Inserting PCF Component


  3. Add your Power Automate flow to the app:

    Add flow in canvas app


  4. Add UI Elements:

    -A text input field (e.g., TextInput1) for the filename

    -A Download button


  5. Set the OnSelect property of the Download button to the following:

    Set(fileDownload, false);

    Set(flowResult, Filetobase64.Run(TextInput1.Text));

    Set(fileBase64, flowResult.base64);

    Set(fileType, flowResult.filetype);

    Set(fileDownload, true);


  6. Bind the PCF component properties to the variables you’ve set:

    Set parameters


  7. Test it out by providing a filename and clicking the Download button

    Set the Parameters







Final Thoughts



This approach provides a secure and user-friendly way to enable file downloads from SharePoint without giving users direct access to the document library. It’s lightweight, flexible, and can be extended to support dynamic files or other data sources.

2. Cyber Threat Intelligence & Forensik

CTI Threat Relationship Graph2 Knoten / 1 Relationen
CVE / Incident Software MITRE ATT&CK CWE Weakness IoC
Ähnliche Beiträge
🔍 Verwandte News

Auch interessante Nachrichten Building a Canvas App PCF Control to Download Files from SharePoint

Thematisch verwandte Begriffe: Building, Canvas, Control, Download · 6 Treffer

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

💬 Kommentare werden geladen…
Zum Aktualisieren ziehen
ZERO-DAY CVE-2026-102367 | mall4j through 4.0 contains an insufficient session expiration vulnerab…
Advisory →
tsecurity.de Icon
Offline-Lesen, Eilmeldungen & 0ms Ladezeit

Installiere tsecurity.de direkt auf deinen Home-Bildschirm für das ultimative Vollbild-Magazinerlebnis ohne Browser-Leisten.

Nächster Beitrag