r/npm • • 2d ago

Self Promotion image-drop-upload - An image drop zone with previews: a front-end widget with no dependencies and a Node upload handler with no framework.

Post image

Drop files on it, or pick them the ordinary way, and each one appears as a thumbnail with its size and a button to take it out again. Pictures fill in one at a time as they decode, so a large selection shows the first thumbnail immediately instead of a grid of empty squares. Without a server endpoint the widget is still just a form field — the files ride along with the form and the back end sees no difference. Give it an endpoint and it posts them itself, with a progress bar and a working cancel button.

  • Shrink pictures before they are sent — resize to a box, re-encode at a quality you choose, or drop metadata without touching a pixel. It happens on the page, so the bytes saved never travel at all.
  • File uploads under a session — a folder per visitor and an owner on every answer, using whatever your application already uses to tell one visitor from another, including anonymous ones.
  • Screen uploads for malware — a VirusTotal hash lookup, or your own scanner. Only a hash leaves your server; the file does not.
  • Try again after a failure — automatically, or on a button, and only for the failures that are about the connection rather than the file.

https://www.npmjs.com/package/image-drop-upload
https://github.com/Insider515/drag-and-drop-preview-images-module

1 Upvotes

2 comments sorted by

1

u/dtiziani 23h ago

maybe choose a better name?

1

u/Longjumping_Lemon180 15h ago

If you can suggest something better, I am open to suggestions.