Skip to content
vedratechPublic

About

File and folder upload library for the browser: drag and drop, folder tree, chunked uploads, pause and resume, retry failed files. React, Angular and plain JS.

Topics

Resources

Code of conduct

Contributing

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

AnyDrop: folder upload for the browser

Drag and drop folder upload in JavaScript and TypeScript, with chunked and resumable uploads, pause and resume, retry and a persistent error list. Works on phones.

npm version npm downloads bundle size CI license: MIT docs

AnyDrop is a front-end upload library that treats folders as first-class objects. It is configured with plain options and events, and has a folder picker and tree view, chunked uploads, pause and resume, a persistent error list, and a layout that works on phones. Packages: @vedratech/anydrop-ui and @vedratech/anydrop-core, with wrappers for React and Next.js and Angular. Badges show the UI package; the badges of the core package are in its README.

AnyDrop uploading a folder with pause and resume

Get started Guide: install, quick start, folders, chunking, resume, offline, errors
React and Next.js, Angular Frameworks: components, event props and outputs, custom rows, SSR
Live demo The real UI, with a simulated network
API reference Every option, method, event, error code and type
Backend The HTTP contract, with Express, Laravel, Python (FastAPI) and Java (Spring Boot) examples

Why AnyDrop

Use it when users upload whole folders, when files are large or the connection is unreliable, or when people use phones.

  • Folder tree, empty folders and a folder manifest for the backend.
  • Chunked uploads with retry on by default.
  • Pause and resume (everything, a folder or one file), also after a page reload (IndexedDB).
  • Automatic handling of offline and unreachable servers.
  • A persistent error list with retry and export.
  • A headless core without a UI.

Uppy and FilePond have plugin ecosystems that AnyDrop does not. If you only need plain file uploads, one of them may suit you better. Sizes are in the Size section.

Guides for common tasks: upload a folder in JavaScript, chunked and resumable uploads, upload large files, pause and resume uploads, uploads that survive a lost connection, folder upload with React, Angular or Vue, Chunked upload backend (Express, Laravel, Python, Java).

Two packages

AnyDrop is frontend only and ships no server: your backend implements a small HTTP contract.

Install

npm install @vedratech/anydrop-ui @vedratech/anydrop-core   # drop zone and UI
npm install @vedratech/anydrop-core                          # headless engine only

From a CDN (pin the minor version). The UI build includes the core and sets window.AnyDrop:

<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@vedratech/anydrop-ui@0.1/dist/style.css" />
<script src="https://cdn.jsdelivr.net/npm/@vedratech/anydrop-ui@0.1"></script>

Minimal example

<div id="uploader"></div>
import { AnyDrop } from '@vedratech/anydrop-ui';
import '@vedratech/anydrop-ui/style.css';

const ad = new AnyDrop('#uploader', {
  url: '/upload',
  chunking: true,
  chunkSize: 5 * 1024 * 1024,
  sendManifest: true, // send the folder structure, including empty folders
  manifestUrl: '/upload/manifest',
});

ad.on('queuecomplete', () => console.log('done', ad.getErrors()));

Headless, with your own drop area (<div id="upload-area">):

import { AnyDropCore } from '@vedratech/anydrop-core';

const core = new AnyDropCore({
  url: '/upload',
  chunking: true,
  sendManifest: true,
  manifestUrl: '/upload/manifest',
});

const area = document.querySelector('#upload-area');
area.addEventListener('dragover', (e) => e.preventDefault());
area.addEventListener('drop', (e) => {
  e.preventDefault();
  core.drop(e); // call synchronously: the browser clears the dropped items afterwards
});

Frameworks

Official wrappers for React and Next.js and for Angular. They need @vedratech/anydrop-ui and @vedratech/anydrop-core next to them.

// React and Next.js (@vedratech/anydrop-react)
import { AnyDrop } from '@vedratech/anydrop-react';

<AnyDrop url="/upload" options={{ chunking: true }} onQueuecomplete={() => console.log('done')} />;
<!-- Angular (@vedratech/anydrop-angular), standalone component -->
<any-drop url="/upload" [options]="{ chunking: true }" (queuecomplete)="done()" />

Both give you an event prop or output for every event, custom rows written as real components, and a headless hook or service. Guides: React and Next.js, Angular.

Features

  • Drag and drop of files and folders together, folder and file pickers, paste. Empty folders are kept, and the backend can receive the structure as a manifest.
  • Chunked uploads with retry with backoff, and Blob.slice() so a file is never loaded into memory whole.
  • Pause and resume for everything, a folder or one file, and resume after a reload (IndexedDB).
  • Bad connections handled: uploads pause by themselves when the browser is offline, the tab is hidden or the server cannot be reached, and carry on when it returns.
  • A persistent error list with a reason per file, retry of failed files only, and JSON or CSV export.
  • Folder events next to the file events. Mobile friendly, accessible, dark mode, every text translatable.
  • ESM, CJS and IIFE builds, TypeScript types, and a pluggable transport for S3, tus or fetch adapters.

Size

Download size, measured the same way for every library (minified and gzipped with esbuild, 1 kB = 1024 bytes, measured 2026-11-08): AnyDrop ui + core 34.7 kB, FilePond 4.32.12 (core, no plugins) 40.5 kB, Uppy core + dashboard + xhr-upload 78.4 kB (CSS excluded). AnyDrop with the UI is less than half the size of Uppy with Dashboard. Method and the CSS numbers: size comparison.

Browser support

Chrome, Edge, Firefox and Safari (desktop), Safari on iOS and iPadOS, Chrome on Android. Safari on iOS has no folder picker and no folder drop, and AnyDrop says so instead of failing. See Mobile and iOS for the table and the iOS limits.

Backend

Your server implements four endpoints: POST /upload (a chunk or a whole file), GET /upload/status, POST /upload/manifest and POST /upload/finalize. Full contract: protocol. Working examples: Express, Laravel, Python (FastAPI) and Java (Spring Boot).

Contributing

pnpm install
pnpm build && pnpm test && pnpm lint && pnpm typecheck && pnpm size
pnpm docs:dev     # the documentation website with hot reload
pnpm docs:build   # builds the packages, the API reference and the site

Maintainer

Created and maintained by Vedra Tech (@vedratech).

License

MIT © 2026 Vedra Tech.

About

File and folder upload library for the browser: drag and drop, folder tree, chunked uploads, pause and resume, retry failed files. React, Angular and plain JS.

Topics

Resources

Code of conduct

Contributing

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages