@oneblink/apps-react
    Preparing search index...

    Function uploadAttachment

    • Upload a submission attachment. Attachment can be passed as a Blob, Uint8Array or string (base64). Will return data required form accessing the attachment.

      const blob = new Blob(['a string of data'], {
      type: 'text/plain',
      })
      const file = {
      formId: 1,
      data: blob,
      fileName: 'file.jpg',
      contentType: 'image/jpeg',
      isPrivate: true, // Whether the attachment will be able to be downloaded by other users
      }
      const abortController = new AbortController()
      const {
      s3: {
      key, // string
      bucket, // string
      region, // string
      },
      url, // string
      contentType, // string
      fileName, // string
      id, //string
      isPrivate, // boolean
      uploadedAt, // string
      } = await submissionService.uploadAttachment(
      file,
      abortController.signal,
      )

      Parameters

      Returns Promise<FormSubmissionAttachment>