web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / How to get the file na...
Power Automate
Unanswered

How to get the file name before downloading a PDF file from a URL

(1) ShareShare
ReportReport
Posted on by 32
I am posting again because when I moved to the new community, some of my past questions were erased from my view.
 

 

How to get the file name before downloading a PDF file from a URL

There is a mechanism in the email that when clicked on, an external URL, other than Microsoft 365, is read by the Edge browser and downloaded as a PDF download.
I would like to place the downloaded PDF file directly into OneDrive or SharePoint Online.
The PDF file changes name randomly each time.


I have confirmed that OneDrive has an action called “Upload file from URL”, and I have done it, but even if I am able to place the file in OneDrive with Automate flow, the PDF file cannot be opened with an error.

Therefore, we would like to obtain the file name before downloading the PDF file from the corresponding URL.
We would like to add the file name to the OneDrive action “Upload file from URL”.


If you have any good ideas on how to get the file name before downloading the PDF file from the URL, please let me know.

Categories:
I have the same question (0)
  • yRgolkkju Profile Picture
    32 on at
    I am trying the file name with the extension (random alphanumeric file name such as XXX) at the end of the file name, the download is complete and the flow is running.
    However, I get the output “Could not open this file (a problem occurred)” and cannot open the PDF file.
  • yRgolkkju Profile Picture
    32 on at
    The file name is not shown at the end of the URL to connect to the pdf and download it.
  • Nived_Nambiar Profile Picture
    18,129 Super User 2025 Season 2 on at
    Hi @yRgolkkju 
     
    So does it meant that even if you provide random file name in upload file action - still it does not work ?
     
     
  • CFernandes Profile Picture
    8,402 Most Valuable Professional on at
    Hey 
     
    >>Therefore, we would like to obtain the file name before downloading the PDF file from the corresponding URL.
    We would like to add the file name to the OneDrive action “Upload file from URL”.
     
    This really depends on the URL-
     
     
    So simple Expression below work
     
    last(split(outputs('File_URL'), '/'))
     
     
    If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!
     
    P.S. take a look at my blog here and like & subscribe to my YouTube Channel thanks.
     
  • yRgolkkju Profile Picture
    32 on at
     
    Thank you for your response.
    I specified a random file name with the .pdf extension added and the flow works and flows correctly, but I cannot open the PDF file.
    I get an error that says this PDF file cannot be opened.
    To download the PDF file, I click on the URL in the body of the email and open it in my Edge browser to download the file.
     

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 525 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 324 Moderator

#3
abm abm Profile Picture

abm abm 232 Most Valuable Professional

Last 30 days Overall leaderboard