Upload Image size 13mb via media-field to REST API, got Error: Maximum request size exceeded

Hi, I try to upload image size 13mb via media-field to my REST API but it show the Error “Maximum request size exceeded”
I think it error in Jigx self before sent a Blob binary to the API because I try to upload via Postman it work fine.

Step reproduce;

  1. This my Jigx form
// demo-upload-file.jigx
title: DEMO UPLOAD FILE
type: jig.default
children:
  - type: component.form
    instanceId: form-media
    options:
      children:
        - type: component.media-field
          instanceId: media-field
          options:
            maximumFileSize: =20 * 1024 * 1024
            mediaType: image
            label: Upload Image
actions:
  - children:
      - type: action.execute-entity
        options:
          title: Upload Image
          provider: DATA_PROVIDER_REST
          function: stub-upload-api
          functionParameters:
            file: =@ctx.components.media-field.state.blob
          entity: uploadImage
          method: create
          goBack: previous
  1. and this Rest function I use any URL now since it got the error before call that URL
// stub-upload-api.jigx

provider: DATA_PROVIDER_REST
method: POST
url: www.google.com
parameters:
  file:
    location: body
    required: true
    type: image
  1. upload image, any image with size 13mb or larger.

I test again,
I cannot upload an image size 2mb
but with an image size below < 1mb, it does.

Hi Nook, this is expected behavior based on how your function is configured. Jigx supports two models to execute REST Functions and is configured using useLocalCall: false the default is false and is typically useful when Secrets (such as API keys) need to secure. In essence, this means the REST function will split processing between the mobile app (local) and the Jigx
REST service (remote). Have a look at the following section in our docs: Local REST Calls - Jigx Guides

When using remote calls you have a size limit, changing this to local by adding useLocalCall: true to your function definition will support large files.

Let me know if you have any questions.

Chat soon,
r

1 Like