Embed Widget

Add a file upload form to any website with a single line of HTML.

Basic embed

<script src="https://drivewidget.com/widget.js"
        data-widget-id="YOUR_WIDGET_ID">
</script>

Place this snippet anywhere in your page's <body>. The widget renders inline at that position.

Standalone upload page

Every widget also has a public URL you can share:

https://drivewidget.com/u/YOUR_SLUG

Works great for QR codes, email links, and client onboarding flows.


Configuration options

All options are set as data-* attributes on the script tag, or inside the Widget Settings panel in your dashboard.

Allowed file types

Restrict which MIME types are accepted:

<script src="https://drivewidget.com/widget.js"
        data-widget-id="YOUR_WIDGET_ID"
        data-allowed-types="image/jpeg,image/png,application/pdf">
</script>

Leave empty to accept any file type.

Max file size

data-max-size-mb="50"

Overrides the plan default. Cannot exceed your plan's limit.

Custom theme

data-primary-color="#7c3aed"
data-button-text="Send Files"
data-title="Upload your documents"
data-description="PDF, JPG, PNG accepted. Max 20MB."

Password protection

Set a password in the dashboard under Widget → Security. Visitors must enter the password before the upload form appears.


Form fields

Collect extra info alongside the file — name, email, project reference, etc.

Enable in the dashboard under Widget → Form Fields. Each submission stores the field values alongside the file metadata, visible in your Drive folder as a .json sidecar file or in your webhook payload.

{
  "filename": "invoice.pdf",
  "fields": {
    "name": "Priya Sharma",
    "email": "priya@example.com",
    "project": "Website Redesign"
  }
}

Custom CSS

Full CSS override is available on Growth plan and above. In the dashboard, open Widget → Custom CSS:

.da-card {
  border-radius: 16px;
  font-family: "Inter", sans-serif;
}
.da-btn-upload {
  background: linear-gradient(135deg, #7c3aed, #a855f7);
  border-radius: 999px;
}
.da-dropzone {
  border: 2px dashed #c4b5fd;
}

CAPTCHA

Enable hCaptcha from Widget → Security to block spam bots on public widgets. Free to use, privacy-friendly.


Domain whitelist

Restrict your widget to specific domains so it only works when embedded on your site:

allowed domains: yourdomain.com, app.yourdomain.com

Set in Widget → Security → Allowed Domains. Requests from unlisted origins are blocked.


File naming patterns

Auto-rename uploaded files using dynamic variables:

VariableExample output
{date}2026-02-27
{time}14-32-05
{name}Form field "name" value
{email}Form field "email" value
{uuid}Unique random ID
{original}Original filename

Example pattern: {date}_{name}_{original}2026-02-27_Priya_invoice.pdf

Set in Widget → Advanced → File Naming Pattern.


Next steps