How to Download a File from a Website with Power Automate

Do you need to download an external file from a website in your flow?

As part of your automation, you might need to get a file from a website and save it to SharePoint each day.

There is no dedicated action for downloading files from the web, but don’t worry, this can still be done in Power Automate.

This post will show you how to get and upload the file to SharePoint.

Download File with HTTP Action

https://www.powertechtips.com/wp-content/uploads/2023/02/Example-Excel-File.xlsx

This example will show you how to get the above file from this site.

Your file might be different each day, but as long as the address and file name is predictable, the process will be the same. You can construct the address with dynamic content or expressions within the HTTP request action.

The HTTP action is versatile and allows you to call any web service using GET, POST, or other request types.

Downloading a file from the internet is essentially a web service. You call a specific address and it returns the file. This is what a GET request does.

This means you can use the HTTP action as a GET request to return the file and then save it in SharePoint.

⚠️ Warning: The HTTP connector is a premium connector so this solution will require premium licensing.

Here are the steps to get the file using the HTTP action.

  1. Add the HTTP action from the HTTP connector.
  2. Select the GET option from the Method type.
  3. Paste in the web address for the file in the URI input. You can also construct the address here with dynamic content and expressions if the address will be different each time the flow runs.

The other inputs of the HTTP action can be left empty.

Save the File to SharePoint

When the flow runs, the HTTP action will return the file in the Body of the output. This is what will be saved to SharePoint as the file.

  1. Add the Create file action from the SharePoint connector.
  2. Select the Site Address of the SharePoint site where you would like to save the file.
  3. Select the Folder Path for the exact location where you want to save the file.
  4. Add the File Name that the output will be saved as. This should also include the correct file extension at the end.
  5. Add the Body dynamic content from the HTTP action to the File Content input.

That’s all! When the flow runs, it will get the file from the website and add it to the SharePoint folder selected.

Conclusions

There is no action dedicated to downloading files from a website, but the HTTP action with a GET request can be used to achieve this.

The Body output from the HTTP action can then be used as the file content when saving the output.

Did you find this useful for getting a file from the web? Let me know in the comments below!

About the Author

John MacDougall

John MacDougall

John is a Microsoft MVP and freelance consultant and trainer specializing in Excel, Power BI, Power Automate, Power Apps and SharePoint. You can find other interesting articles from John on his blog or YouTube channel.

Related Articles

Comments

0 Comments

Get the Latest Tech Tips

Write For Us

Are you a tech enthusiast with a talent for writing great content? Come write for us!

Follow Us

Follow us on social media to stay up to date with the latest in tech!