SharePoint is all about document management. Therefore to get file content from a file must be something easy.
Well it is that easy that there are at least 3 methods of doing this.
- Get file content action
- Get file content by path action
- Send an HTTP request to SharePoint action
In this post I’m looking at the first two options.
Both Get file content and Get file content using path actions look very similar and I would probably question why there are two actions for this.
In the above action I selected the files that I wanted to read form the little folder icons at the right.
When I typed the url for both action however, I found that I got the following error:
{ "status": 400, "message": "Route did not match\r\nclientRequestId: 1dfab1da-028e-4761-b024-e8e5460146b0\r\nserviceRequestId: 1dfab1da-028e-4761-b024-e8e5460146b0" }
Well, that is not pretty!
The get file content using path did still work. Then I thought about using the Get files and use the file identifier for the file instead and this works.
This now shows the difference between the two options. When you use the get file content the url needs to have the spaces and slashes in the url encoded.However strangely enough this seems to only be the case when you try to use dynamic content or manually supply the file details. As we saw earlier the /Shared Documents/Document.docx worked perfectly fine when I selected the file manually. The other strange thing I noticed is that the leading slash has disappeared when when the file identifier is selected from the Dynamic content.
I want to create a flow that, when a file is created the file gets sent via e-mail. How do I do that while working around this bug. I get 404 probably due to the URL not being encoded correctly.
Hi Christian,
I would create something like this:
Does the third option – “Send an HTTP request to SharePoint” – allow the 100MB limit to be bypassed? If so, what parameters need to be submitted?
To answer my own question: the URI is _api/Web/GetFileByServerRelativeUrl(‘[path-goes-here]’)/OpenBinaryStream, but the 100MB limit remains.