Skip to content
use-cases / drag-drop-uploads-into-your-script / hero
PIPE · BROWSER → STDIN

Drag-drop uploads into your script, no upload code written

hoody-pipe already serves a web upload form at every path it owns. Drag a file onto the page, the bytes stream through the pipe and into your script's stdin. You wrote zero lines of upload code.

Read the pipe docs

no upload code, no S3 bucket, no presigned URLs

use-cases / drag-drop-uploads-into-your-script / mechanism

How a drag becomes a stream

hoody-pipe runs a web UI at the path root and a JavaScript-free fallback at /noscript. Both stream multipart bytes straight through to whoever is reading the same path. Your script reads the pipe — that's all the wiring there is.

browser → pipe → stdin4 STEPS · ZERO HANDLERS
  • 01

    Pick a path, share the URL

    https://pipe.hoody.com/upload

    Any path you haven't reserved becomes a pipe. The URL is the upload page.

  • 02

    User drops a file in the browser

    GET /upload — auto-served upload form

    Hoody serves the form for you: drop zone, multipart parser, CSP nonce, all included. /noscript exists for restricted browsers.

  • 03

    Bytes stream through the pipe

    PUT /api/v1/pipe/upload (multipart/form-data)

    The first multipart part is unwrapped and streamed to the receiver. No server-side staging, no temp files.

  • 04

    Your script reads stdin

    curl …/api/v1/pipe/upload | python process.py

    Receiver and sender connect within a 5-minute TTL. The script doesn't know it's behind a webpage — it just reads the bytes.

process.sh
# 1. your script reads the pipe
$curl https://pipe.hoody.com/api/v1/pipe/upload | python process.py
# 2. someone opens https://pipe.hoody.com/upload in a browser,
# drops invoice-q3.pdf onto the page,
# the form PUTs the bytes through to you.
# 3. your script processes stdin and finishes
[OK]saved to /data/uploads/invoice-q3.pdf

The pipe is the upload server. Your script is the receiver. There is no third process — no Lambda, no API gateway, no glue function — between the drop zone and your stdin.

use-cases / drag-drop-uploads-into-your-script / no-code

What you didn't have to write

Every item below is a normal day's work to build for a one-off uploader. The pipe ships with all of it.

WEB FORM

Drop zone, file picker, progress

The pipe UI renders a drag-drop area, a click-to-pick fallback, and progress feedback. /noscript serves a pure HTML form for browsers without JS — same path, no extra code.

TRANSPORT

Multipart parsing and streaming

When the browser POSTs multipart/form-data, the server extracts the first part and streams it. No body buffering, no temp file cleanup, no ten-line multipart library.

SECURITY

CSP nonce, MIME safety, CORS preflight

The form ships with a fresh CSP nonce. Dangerous content types (text/html, image/svg+xml, application/javascript) are rewritten to text/plain before reaching you. OPTIONS handles cross-origin preflight.

CONNECTION

Receiver-first or sender-first, your call

Run your script before anyone uploads, or after — the pipe holds the connection up to a 5-minute TTL until both ends are present. Receiver count (n) is configurable up to 256.

use-cases / drag-drop-uploads-into-your-script / compare

What this replaces

Side by side: the upload pipeline you would have built, versus the URL you point at your script.

ConcernWhat you would writeWhat Hoody hands you
  • Upload formFlask app + dropzone.js + CSSGET /upload — already a form
  • Multipart parsingMulter / formidable / busboyFirst part unwrapped on the wire
  • StorageS3 bucket + presigned URL endpointStream straight into your script
  • RoutingAPI Gateway + Lambda + IAMPick a path, that's the route
  • JS-disabled fallbackSecond form, server-rendered/noscript serves it for free
  • Security headersCSP, nonce, CORS, MIME guardsShipped with the pipe
use-cases / drag-drop-uploads-into-your-script / punchline

You wrote the script. Hoody wrote the upload form.

YOU SHIPPED

process.py — read stdin, do the work

while read chunk; do …
HOODY SHIPPED

the page, the form, the parser, the security

GET /upload — auto-served
Read the pipe docs
use-cases / drag-drop-uploads-into-your-script / replaces

What this replaces

The patterns developers reach for when they need a one-off file upload. Each one charges a setup tax — buckets to provision, middleware to install, signing keys to rotate. The pipe is a URL.

  • AWS S3 (presigned URLs + bucket)Provision a bucket, sign URLs, expire them
  • Custom routing endpointsPer-upload route, hand-built and forgotten
  • Multer / formidable middlewareMultipart library to install and babysit
  • Hosted dropzone servicesThird-party SaaS, separate billing
  • S3 + Lambda upload pipelinesTwo services and IAM glue for one form
  • Filestack / UploadcareVendor SDK, vendor lock-in, vendor pricing
use-cases / drag-drop-uploads-into-your-script / cta

Pick a path. Read the pipe. The upload form is already live at that URL.

use-cases / drag-drop-uploads-into-your-script / related

Read the others