1
votes

enter image description hereI have created a Web API using .net core to POST file (excel).

When attaching the file from the post man it is working as expected but now I am trying to do the same using Azure logic app.

I am using a FTP connector and reading the file from it and then calling the REST api, the end point is getting hit but however I am unable to get the file data.

I am very much new to logic apps and tried to find a lot but no luck.

Web API

[HttpPost("x")]
public async Task<IActionResult> MigrateHistoricalData()
{
    int filesCount = HttpContext.Request.Form.Files.Count;
    if (filesCount > 0)
    {
        var file = HttpContext.Request.Form.Files[0];
        if (file != null && file.Length > 0)
        {
            // other logic
        }
     }
    else
    {
         return new BadRequestObjectResult("No files found in the request.");
    }

   return null;
}

Error Image: enter image description here

2

2 Answers

1
votes

You could update your browser to the latest version and have a try.

It's a MVC bug, and on 13th of September 2018 Microsoft has implemented a fix for this issue, and it will be released with in ASP.NET Core 2.2.

0
votes

Set content-type of the HTTP request header to multipart/form-data in the Logic App and see if that helps Logic App Http Connector Header