cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Cyrano
Level: Powered On

HTTP get download file

Hi all,

 

Scenario:

I created a flow which polls for new messages from office365servicecomms-API, filters for inicident-posts and which then pushed those messages into our MS Teams-channel.

 

Now I wanted to extend this flow to fetch the Post-Incident-Reports URL (example: PIR-Link (you need to be authenticated)), downloads the file, uploads it to our group connected SharePoint-Teamsite and which finally adds a share-link to the corresponding post in our Teams-Channel.

 

Problem:

I am using this HTTP-action as part of a bigger flow to fetch the PIR-file:

 
{
"inputs": {
"method": "GET",
"uri": "@{item()?['PostIncidentDocumentUrl']}",
"headers": {
"Content-Type": "application/json",
"Accept-Encoding": "",
"Accept": "application/vnd.openxmlformats-officedocument.wordprocessingml.document",
"Accept-Language": "en-US,de-DE;q=0.98"
 },
"authentication": {
"type": "ActiveDirectoryOAuth",
"tenant": "<SECRET>",
"audience": "https://manage.office.com",
"clientId": "<SECRET>",
"secret": "<SECRET>"
 }
 },
"operationOptions": "DisableAsyncPattern, DisableAutomaticDecompression, SuppressWorkflowHeaders",
"runtimeConfiguration": {
"contentTransfer": {
"transferMode": "Chunked"
 }
 }
}

The body from the response is corrupt (you cannot open the file in word). The issue seem to be that the office365servicecomms-API sends a wrong content-type-header:

statusCode200
headers 
Pragma"no-cache"
X-Instance-Name"Office365ServiceCommsWeb…iceCommsWebService_IN_1"
X-Activity-Id"f070d1ac-e9a6-4434-aa08-f761db12c26a"
X-Time-Taken"498"
Cache-Control"no-cache"
Date"Mon, 04 Mar 2019 10:17:22 GMT"
Server"Microsoft-IIS/10.0"
X-AspNet-Version"4.0.30319"
X-Powered-By"ASP.NET"
Content-Length"116850"
Content-Disposition"attachment; filename=PIR_TM173414_en-us_docx.docx"
Content-Type"text/html"
Expires"-1"
body"PK\u0003\u0004\u0014\u00…u0001\u0000\u0000\u0000"

 

Postman, IE and Edge seem to be robust enough, to ignore the wrong content-type, but FLOW seem to add UTF-encoding into the binary response, causing a corrupt file.

 

Any ideas to work around that issue? Any suggestions to address this issue to Microsoft (beside opening a pemier-support ticket)?

 

2 REPLIES 2
Community Support Team
Community Support Team

Re: HTTP get download file

Hi @Cyrano ,

 

Could you share a screenshot of your flow?

By the way, a URL of the flow would be helpful.

Have you got any error message on the flow?

Please help collect more info on this issue.

 

Best regards,

Mabel

 

Community Support Team _ Mabel Mao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Cyrano
Level: Powered On

Re: HTTP get download file

Hi @v-yamao-msft ,

 

my support ticket was escalated to the flow product group and they forwarded the ticket to the team managing the /ServiceComms/Messages-API. They are now checking if, how and when they are going to fix it.

 

I will send an update as soon as I get (hopefully good) news.

 

best regards
Patrick

Helpful resources

Announcements
firstImage

Power Platform Online Conference

Join us for the first ever Power Platform Online Conference!

firstImage

Incoming: New and improved badges!

Look out for new contribution recognition badges coming SOON!

firstImage

New & Improved Power Automate Community Cookbook

We've updated and improved the layout and uploading format of the Power Automate Cookbook!

thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Power Platform World Tour

Find out where you can attend!

seventhimage

Webinars & Video Gallery

Watch & learn from the Power Automate Community Video Gallery!

Top Solution Authors
Top Kudoed Authors
Users online (4,967)