Skip to content

Dropzone.js Alternatives for PHP

Dropzone is a good library, and for a lot of projects it is still the right answer. People go looking for an alternative for three specific reasons — and only one of them is really about Dropzone. Here is how to tell which applies to you.

Reason 1: the release situation

Dropzone's most recent tagged release is v6.0.0-beta.2, published in November 2021. The repository is not abandoned — there has been commit activity as recently as this month — but a project that has sat on a beta tag for that long makes some teams uncomfortable, and many stay pinned to the older 5.x line instead.

That is a reasonable thing to weigh, but weigh it accurately: an MIT-licensed, widely deployed, feature-complete client library that has not changed in a while is a very different risk from an archived one like jQuery-File-Upload. If Dropzone does what you need today, "no releases lately" is not by itself a reason to migrate.

Reason 2: the server half is still yours

This is the one that actually bites. Dropzone is a browser library: it collects files, shows progress and posts multipart requests. Everything after that is your PHP:

Swapping Dropzone for FilePond or another client library does not change any of that. If your friction is server-side, a different front end is not the fix.

Reason 3: a feature it does not have

Dropzone deliberately keeps a small surface. If you need resumable uploads that survive a dropped connection, imports from Dropbox or Google Drive, or an image editor before upload, you are not looking for a Dropzone alternative so much as a larger tool.

The alternatives, briefly

OptionLicenceWhy you would switch
UppyMITActively released, resumable via tus, remote sources (needs its Node service), modular
FilePondMITBetter-looking out of the box, strong image handling; you still define the server contract
Plain <input type="file">For one optional attachment, a library is overkill
A server componentCommercialYou want the PHP half handled too, not just the browser half

Fuller detail, with release dates and licences checked, is in PHP upload libraries compared.

Before you migrate: write the drop zone yourself

A drop zone is genuinely small. If Dropzone's interface is all you use it for, this replaces it in about thirty lines — and removes a dependency rather than swapping one for another:

const zone = document.getElementById('zone');
const input = document.getElementById('picker');

// dragover must be cancelled too, or the browser just opens the file
['dragenter','dragover','dragleave','drop'].forEach(t =>
  zone.addEventListener(t, e => { e.preventDefault(); e.stopPropagation(); }));

let depth = 0;                                   // children fire dragleave, so count
zone.addEventListener('dragenter', () => { if (++depth === 1) zone.classList.add('over'); });
zone.addEventListener('dragleave', () => { if (--depth === 0) zone.classList.remove('over'); });

zone.addEventListener('drop', e => {
  depth = 0; zone.classList.remove('over');
  send([...e.dataTransfer.files]);
});

zone.addEventListener('click', () => input.click());
input.addEventListener('change', () => send([...input.files]));

function send(files) {
  const body = new FormData();
  files.forEach(f => body.append('files[]', f));
  const xhr = new XMLHttpRequest();
  xhr.open('POST', '/upload.php');
  xhr.upload.onprogress = e =>                   // note: xhr.upload, not xhr
    e.lengthComputable && setPercent(e.loaded / e.total * 100);
  xhr.onload = () => render(JSON.parse(xhr.responseText));
  xhr.send(body);
}

The details that make it feel finished — folder drops, paste-to-upload, keyboard access — are covered in the drag-and-drop guide.

Where this component fits

PHP File Uploader is not a Dropzone competitor in the like-for-like sense: it is a PHP component that renders its own browser UI, so the server half comes with it rather than being left to you. That is the whole difference, and whether it is worth a licence fee depends entirely on how much the server half is costing you.

It is commercial, and single-vendor, and for a single optional attachment on one form it is more than you need — Dropzone with the 40 lines of PHP above will serve you fine. It earns its place when uploads are central: many files, large files, or a team that would rather not own that code path.

There are four drag-and-drop demos — panel, compact bar, whole-page overlay and avatar with preview — all running live, no sign-up.