Product EngineeringFeaturesLab FormsFrontendcrelio-app

File Upload & Signature

File upload and signature capture flows in the patient UI, including S3 integration.

👤 Ritu Kataria📅 Updated: Mar 13, 2026🏷️ feature

File Upload & Signature

Both file uploads and signature capture follow a presigned S3 URL pattern — the patient UI never sends binary data through the application server.


Signature — CustomSignature

Library: react-signature-canvas

Flow:

  1. Patient draws signature on the canvas
  2. On stroke completion, canvas is converted to a JPEG data URL
  3. On Save:
    • Fetch presigned URL from POST /api-v3/generate-presigned-url/
    • Convert data URL → Blob → File
    • PUT file directly to S3 presigned URL
    • Call onChange(fieldId, { bucketPath: s3Key, value: dataUrl })
    • Reconcile via POST /sm_reconcile_presigned_url/
  4. S3 path: consent/<patient_id>/ with a UUID filename

Value stored in Redux: { bucketPath: "<s3-key>", value: "<data-url>" }


File Upload — Upload

Supports three input modes: standard file input, webcam capture (Camera), and image selection.

Validation (pre-upload):

  • File count: min_number_upload_file / max_number_upload_file
  • File size: file_size attribute
  • Duplicate detection (by filename)

Upload flow (per file):

  1. POST /api-v3/generate-presigned-url/ — get S3 presigned upload URL
  2. PUT directly to S3 presigned URL
  3. POST /sm_reconcile_presigned_url/ — confirm upload and reconcile file path

Value stored in Redux: { [fileName]: s3Key } map


API Calls for Uploads

EndpointPurpose
POST /api-v3/generate-presigned-url/Get S3 presigned upload URL
PUT {presigned-url}Upload file directly to S3
POST /sm_reconcile_presigned_url/Confirm upload and reconcile file path

On this page