0

I am using ASP.NET Web API project with Swashbuckle to test a simple custom API app that accepts 2 parameters: file name and file content.

public class Parm
{
    public string FileName { get; set; }
    public string FileContent { get; set; }
}

Swagger:

{
  "FileName": "string",
  "FileContent": "string"
}

I have an issue integrating this API app with Logic apps, e.g. process all files created in OneDrive folder as follows:

  1. "When a file is created" trigger in OneDrive
  2. Call the custom API app with parameters File name and File content from the previous step.

As long as uploaded files are relatively small everything works fine, however for larger files (e.g. 10 MB) FileContent is received as null, and the logic of the process understandably fails.

Any idea what can be the reason of the problem? I've tried changing FileContent from string to other types (Stream, etc.), however that wouldn't work. Only following parameters from the previous step are available: File content, File content type, File entity tag, File identifier, File name and File path.

Standard API's such as "Azure Blob Storage - Create blob", etc. don't have any issue processing large File content so there surely must be a way to achieve it. Thanks.

1 Answer 1

1

The problem can be fixed by increasing the value of the HttpRuntimeSection.MaxRequestLength property in the API app's Web.config:

<configuration>  
    <system.web>  
        <httpRuntime maxRequestLength="12288" />  
    </system.web>  
</configuration>

Default value is 4096 KB.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.