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 Automate / How to check if file u...
Power Automate
Unanswered

How to check if file uploaded is a genuine PDF and not just a renamed file?

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

Hello everyone,

 

In my PowerApps form, users have the capability to upload PDF files. While I've already implemented a basic check to ensure the files are PDFs by disabling all controls until the user resolves any discrepancies, I'm worried this might not be sufficient. Here's a snippet of the code I'm currently using:

 

CountRows(
     Filter(
          DataCardValue41.Attachments,
          Lower(Right(Name, 4)) <> ".pdf"
     )
) > 0

This method works well for the most part, but since PowerApps forms will accept any allowed file types, a potential concern arises. A mischievous user could simply rename a .txt file to a .pdf, which could cause problems when I attempt to merge or combine all the uploaded PDF files using PowerAutomate. I haven't been able to test this scenario yet because we're still in the process of considering the purchase of a premium license.

 

With this in mind, my question is: Is there a way to validate that the uploaded file is a legitimate PDF using PowerAutomate beyond just checking the file extension? Any insights would be greatly appreciated!

 

PS: Sorry if I put a wrong "Labels" and/or "Message Tags", this is my first post. Thanks.

Categories:
  • Nived_Nambiar Profile Picture
    18,138 Super User 2026 Season 1 on at

    Hi @Anonymous 

     

    Is there any text/word in pdf which makes it to look as legitimate source ?

     

    So that we can do a filter based on its content ?

     

    Let me know 

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 Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Automate

#1
Mohsin Ali Profile Picture

Mohsin Ali 430

#2
11manish Profile Picture

11manish 341 Super User 2026 Season 2

#3
M Bilal Khan Profile Picture

M Bilal Khan 282

Last 30 days Overall leaderboard