I’m pretty new to UiPath and have very little experience with API’s so I’m hoping you’re going to be able to help me.
I’m triggering a BOT via the Orchestrator and then hoping to return an Excel file with an ‘HTTP request’ activity.
I’ve already got another similar process that is returning a PDF file and that is working fine.
The End Point is receiving data but when I try to open the Excel is gives me the following message : “Excel cannot open the file “testfile.xlsx” because the file format or file extension is not valid. Verify that the file has not been corrupted and that the file extension matches the format of the file”
I’m using the POST Method. The BodyFormat is application/xml and I’m simply including the Attachment where I’ve indicated a string variable with the file path and the a Header.
Can you help? Is it possible to pass an Excel file this way?
Thanks in advance.
The files downloaded from internet are blocked for security reasons.
Can you check the properties of Excel and unblock if it is blocked.
have you ever managed to get it working?
I have the same issue right now…
i’m facing the same issue, do you have a solution by any chance? Thanks
yeah, I used invoke code with code below
these headers are to upload to azure blob storage, you will need to replace with the headers that you need.
using (System.Net.Http.HttpClient client = new System.Net.Http.HttpClient())
client.BaseAddress = new Uri("https://"+uri.DnsSafeHost);
var byteContent = File.ReadAllBytes(file.FullName);
using (System.Net.Http.HttpResponseMessage response = client.PutAsync(uri.PathAndQuery, new System.Net.Http.ByteArrayContent(byteContent)).Result)
exceptionMessage = e.Message;