Hi All,
I am trying to download file from url. But the thing is it can any extension like .pdf or .PDF or .xlsx or.XLSX .
How can I download multiple extension file form url
Hi All,
I am trying to download file from url. But the thing is it can any extension like .pdf or .PDF or .xlsx or.XLSX .
How can I download multiple extension file form url
Is it possible to download via front end ?
You can use Download file from URL
activity for this.
Not very stable the UI
Make sure the full URL from which to download the file from is passed correctly.
The URL must include the http://
or https://
prefix and ending with the file name and extension. This makes the full URL.
For example this UiPath Forum URL
https://global.discourse-cdn.com/uipath/original/3X/0/e/0e831d5d6f7fd6f49812e383415cb145d257ef94.png
My url is something like this and also extension can vary. It can be .pdf or .PDF or .xlsx
Download file url can be used but it should have full url along with extension you want as well…how are you getting the url?
Also for download file url the file would be returned as ilresource …so you might need to check the temporary location
Cheers
I tried using Invoke Activity code but since extensions vary like.xlsx or .pdf or .PDF , I am getting error
Then try to loop through each possible extension with try catch around it so that which ever is correct it eould downlod and you can proceed
Cheers
If you are getting the full URL then you are sorted.
Just leave the Save file as property empty and it will save the file with the same extension as the URL.
Save file as - Use a custom name for the downloaded file. If left empty, the activity determines the file name based on URL information.
Hello,
when using the activity “Download file from URL”, the downloaded file does not go to your local Downloads folder but instead it goes inside your UiPath project folder. What you can do is set the output of the “Download file from URL” to a variable like DownloadedFile and then use a Move File activity to move the file to your desired folder.
If you want to use code, first modify the path to indicate just the folder ex: “C:\Users\rpaservicerobot\Downloads”
then try using the following code:
’ Extract the file name from the URL
Dim fileName As String = System.IO.Path.GetFileName(New Uri(url).LocalPath)
’ Combine the local directory path and the file name
Dim fullPath As String = System.IO.Path.Combine(path, fileName)
’ Use the WebClient class to download the file
Using wc As New System.Net.WebClient()
wc.DownloadFile(url, fullPath)
End Using
Use Url browser using the url (Navigate to download)
Send Keybiard shortcut keys (Control+s)
Save as
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.