SR050

Severity: error

Summary: upload declared on an endpoint whose method is not POST, PATCH, or PUT

What this means

An endpoint has an upload: block but its HTTP method is not POST, PATCH, or PUT. File uploads require a method that accepts a request body with multipart form data. GET and DELETE endpoints cannot receive file uploads.

Example that triggers this

endpoints:
  upload_file:
    method: GET
    path: /assets/upload
    input: [file]
    upload:
      field: file
      storage: s3
      max_size: 5mb

How to fix it

Change the endpoint method to POST, PATCH, or PUT.


Back to top

Shaperail documentation lives in the same repository as the framework so every release has versioned instructions. See the latest release for the most recent version.

This site uses Just the Docs, a documentation theme for Jekyll.