Chapter 02Getting Started & Ingestion
4 min read

Multipart File Uploads, Digital Signatures & Google Drive Sync

Accept resumes, PDFs, images, and captured HTML5 canvas signatures in a single submission request, with inline inbox previews and one-click Google Drive offloading.

Key Technical Takeaways (TL;DR)
  • Send multipart/form-data payloads containing one or more binary File fields without setting a manual Content-Type boundary.
  • Capture digital signatures as data:image/png;base64,... strings; FormFork renders them inline in the submission inspector and Client Portal.
  • Connect Google Drive via non-invasive drive.file OAuth to offload uploaded files directly into your Google Drive folder.
  • Stream or download attached files via GET /api/files/{fileId} with Owner, Admin, or Agency Client Inbox authorization.

1. Multipart File Upload & Digital Signature Submission

Use browser FormData to combine standard text inputs, binary File objects from <input type="file">, and Base64 PNG data URIs from a signature canvas in a single POST request.

javascriptJavaScript FormData with File Attachment & Base64 Signature
// Do NOT manually set Content-Type when passing FormData; the browser
// automatically attaches multipart/form-data with the correct boundary.
async function submitApplication(fileInput, signatureCanvas) {
  const formData = new FormData();
  formData.append('name', 'Jane Doe');
  formData.append('email', 'jane@company.com');
  formData.append('role', 'Senior Product Designer');

  // Attach binary file (PDF, DOCX, PNG, JPG, ZIP)
  if (fileInput.files && fileInput.files[0]) {
    formData.append('resume_file', fileInput.files[0]);
  }

  // Attach Base64 PNG digital signature from HTML5 <canvas>
  if (signatureCanvas) {
    formData.append('applicant_signature', signatureCanvas.toDataURL('image/png'));
  }

  formData.append('_gotcha', '');

  const response = await fetch('https://formfork.io/f/{form_id}', {
    method: 'POST',
    headers: {
      'Accept': 'application/json',
    },
    body: formData,
  });

  return await response.json();
}
htmlDeclarative HTML Multipart Form
<form
  action="https://formfork.io/f/{form_id}"
  method="POST"
  enctype="multipart/form-data"
>
  <input type="text" name="full_name" placeholder="Full Name" required />
  <input type="email" name="email" placeholder="Email Address" required />
  <input type="file" name="attachment" accept=".pdf,.png,.jpg,.jpeg,.doc,.docx" required />
  <input type="text" name="_gotcha" style="display:none" tabindex="-1" autocomplete="off" />
  <button type="submit">Upload &amp; Submit</button>
</form>

2. Normalized File Metadata & Google Drive Offload

Every submission returned by GET /api/submissions, GET /api/v1/forms/:id/submissions, or GET /api/client-portal/submissions includes a normalized files[] array for instant inline previewing or downloading.

jsonNormalized Submission File Record Schema
{
  "id": "file_1729624800_x8k2p",
  "submissionId": "sub-1729624800-k4m9p",
  "formId": "form-careers-intake",
  "fieldName": "resume_file",
  "originalName": "jane-doe-resume-2026.pdf",
  "mimeType": "application/pdf",
  "sizeBytes": 184320,
  "storageNode": "local",
  "driveFileId": null,
  "driveWebViewLink": null,
  "createdAt": "2026-10-22T18:30:00.000Z"
}
Storage State (storageNode)BehaviorAccess URL
localStored in FormFork encrypted file buffer with inline preview & download.GET /api/files/{fileId}?token={jwt}
google-driveOffloaded to connected Google Drive folder via drive.file OAuth scope.file.driveWebViewLink (Direct Google Drive URL)
purgedAutomatically recycled when local rolling FIFO storage cap is exceeded.Metadata retained; binary purged unless synced to Drive

Frequently Asked Technical Questions

Can Agency Client Inbox users preview and download attached files?

Yes. Both full FormFork account owners and Agency Client Inbox users (via /client-portal) are authorized to preview images, PDFs, and text files inline and download attachments or open Google Drive links.

What Google OAuth scope does FormFork use for Google Drive sync?

FormFork requests only https://www.googleapis.com/auth/drive.file, which grants access solely to files and folders created by FormFork and never reads your existing personal Drive files.

All FormFork Documentation Guides

View Full Documentation Index →