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 :
Power Platform Community / Forums / Power Apps / File uploaded to the S...
Power Apps
Answered

File uploaded to the SharePoint cannot be accessed.

(1) ShareShare
ReportReport
Posted on by

Hello,

I have created the file upload feature and automate flow to save the uploaded file to the Share Point.

But, the preview of the uploaded file is blank and the file cannot be viewed since it shows as follows.

Thinzar_0-1719984744080.png

File uploading formula is as follows.

ForAll(
    fileUploadCol,
    fileUploadSP.Run(
        {
            contentBytes: fileUploadCol[@Value],
            name: fileUploadCol[@Name]
        }
    )
);
And the automate flow is as follows.
Thinzar_1-1719984825953.png

Is there anything wrong with my flow and formula? And how could I solve it?

Thanks.

 

Categories:
I have the same question (0)
  • v-yueyun-msft Profile Picture
    Microsoft Employee on at

    Hi , @Thinzar 

    What's the data type you put in your Power Apps V2 trigger:

    vyueyunmsft_0-1719985606389.png

    And dose your "fileUploadCol" is from a Attachments control?

     

    Secondly, there may have a bug in the new designer, you can try to switch to Classic mode and recreate the action to test again.

    vyueyunmsft_1-1719985723433.png

     

    【My Test flow】

    vyueyunmsft_0-1719988325938.png

    And this is the code i use in my app:

    ForAll( 'Attach Control'.Attachments , PowerAppTest.Run( {file: {contentBytes: ThisRecord.Value ,name: ThisRecord.Name}}  )  )

     

     

    Best Regards,

    Yueyun Zhang

     

     

  • WillPage Profile Picture
    2,323 Super User 2026 Season 1 on at

    Use the JSON() function to convert the uploaded file to base64. Without that you send a appres:// blob uri to the flow which doesn't contain the file content.
    For example I have a media upload control. I upload a file then in the OnSelect formula of a button, have this formula:

    WillPage_0-1719985758256.png

    The base64 there is the contents of the variable after clicking the button. You can send that to your flow and use as the file content after some minor data transformation.

  • Thinzar Profile Picture
    on at

    Yes, my "fileUploadCol" is from a Attachment control taken from form control.

    Thinzar_0-1719990807324.png

    Thanks, @v-yueyun-msft .

     

    The file is successfully uploaded if I remove the compose part (which concats the file name with the utcNow()).

    However, there is a problem that if the file with same name is uploaded, the file does not appear in the SharePoint.

    The concat part is to prevent the above problem. So, is there any way to allow files with same filename in SharePoint? Or how could I overcome this?

     

  • Thinzar Profile Picture
    on at

    Thanks, @WillPage 

    Does it work on pdf files also?

  • WillPage Profile Picture
    2,323 Super User 2026 Season 1 on at

    It actually does. The media/image uploader control is more versatile than it looks. When you drop the control into the canvas it's actually a group containing the button and an image control (for viewing). You can ungroup and delete the image control, just leaving the button. The file selection dialogue has the file type set to image files but you can switch that to all files and choose a non-image. Then the binary of the file is accessible via the .Media property of the button.

     

    It works but it's annoying for the users having to switch the file type each time when browsing for the file.

  • Verified answer
    v-yueyun-msft Profile Picture
    Microsoft Employee on at

    Hi , @Thinzar 

    You can try to use this expression in your "File Name" field:

    vyueyunmsft_0-1719992679625.png

     

    concat(split( triggerBody()?['file']?['name'] , '.')?[0], '_' , utcNow('yyyyMMddHHmmss') ,'.', split( triggerBody()?['file']?['name'] , '.')?[1] )

     

    The result is as follows:

    vyueyunmsft_0-1719993718867.png

     

     

    If this reply can help you , you can click mark this reply as solution (Accept solution) which can help more people, thanks in advance! 

     

    Best Regards,

    Yueyun Zhang

     

     

     

  • Thinzar Profile Picture
    on at

    Thanks, @v-yueyun-msft .

    It works. 

    Also Thanks to @WillPage  for the suggestion. 

     

    Btw, is there any way to get the uploaded file from the power apps. Like displaying the uploaded pdf to the power apps screen, allowing the download option?

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 530

#2
WarrenBelz Profile Picture

WarrenBelz 459 Most Valuable Professional

#3
Haque Profile Picture

Haque 314

Last 30 days Overall leaderboard