Streaming Uploads with LiveView

Phoenix devs cheer, Ops say “just use S3”—comment war erupts

TLDR: Fly.io’s LiveView now streams file uploads with a new UploadWriter, promising simpler, real‑time handling. The community is split between fans celebrating less complexity and skeptics warning to stick with direct‑to‑S3 for big, cheap, reliable uploads—making this a must‑watch for anyone building apps with user files.

Fly.io just demoed streaming file uploads in Phoenix LiveView, and the comments lit up like a server room at 3am. The feature—an UploadWriter that streams files in chunks over a web socket—promises real‑time progress, automatic cleanup, and fewer "abomination stacks" (their words) of queues, scripts, and mystery microservices. Elixir fans shouted "finally!" while Ops folks clutched their cloud bills and muttered, "Direct to S3 or bust." The split is spicy: one camp loves the idea of processing uploads as they arrive, the other says funneling big videos through your app is a stress test you didn’t sign up for.

The strongest opinions? Cost and reliability. Skeptics argue you’ll still end up pushing everything to Amazon’s storage anyway, so why not start there. Supporters say LiveView’s chunked streaming gives power to handle cropping, virus checks, and sending files to multiple places without duct‑tape architecture. Drama erupted over web sockets (“20GB over a chat line?”), while devs posted memes of the dreaded "FFmpeg PTSD" and the classic: "No one ever got fired for choosing S3." Meanwhile, Fly.io’s swagger about hiding complexity drew applause and side‑eye. The vibe: exciting tool, but not magic—you still have to make choices.

Want receipts? Check out Fly.io and the Phoenix LiveView docs for the gritty bits. For now, the thread reads like a cloud‑era soap opera: hype vs. hard truths.

Key Points

  • The article explains the persistent complexity of browser-based file uploads and why direct-to-S3 is a common baseline solution.
  • Phoenix LiveView supports built-in uploads using allow_upload/3, live_file_input/1, and consume_uploaded_entries/3, providing progress, drag-and-drop, multiple files, and temp file cleanup.
  • Built-in uploads have limitations for very large files, real-time processing, multi-destination writes, and transformations.
  • LiveView.UploadWriter, configured via the :writer option, enables chunked, streaming uploads with full control over file consumption.
  • The default UploadTmpFileWriter writes chunks to a temporary file, and developers can implement custom writers (e.g., to perform S3 multipart uploads or write to multiple destinations).

Hottest takes

"Stop trying to replace S3; just give me presigned URLs" — bucketBoss
"Finally uploads without a microservice Hunger Games" — beamDream
"WebSockets for 20GB videos? Y’all brave" — opsGoblin
Made with <3 by @siedrix and @shesho from CDMX. Powered by Forge&Hive.