Lovable storage

Large File Downloads Timing Out in Lovable App

Users trying to download large files (PDFs, exports, media) from your Lovable app experience timeouts, incomplete downloads, or connection resets. The download starts but never completes, or fails with a network error.

This commonly happens with generated reports, data exports, or media files that exceed a few megabytes. The download may work fine for small files but consistently fail for anything larger.

The problem is worse on mobile connections and may appear as a spinning indicator that never completes or a partially downloaded corrupt file.

Error Messages You Might See

net::ERR_CONNECTION_RESET Download failed - network error Function execution timed out Error: The operation was aborted
net::ERR_CONNECTION_RESETDownload failed - network errorFunction execution timed outError: The operation was aborted

Common Causes

  • Serverless function timeout — Edge functions have execution time limits (typically 10-30 seconds) that large downloads exceed
  • File loaded into memory — The entire file is read into memory before sending, instead of being streamed
  • No resume support — If the connection drops, the download must restart from the beginning
  • CORS on storage URLs — Direct storage URLs may not have proper CORS headers for browser downloads

How to Fix It

  1. Use signed URLs for direct download — Generate a temporary signed URL from Supabase Storage and redirect users to it instead of proxying the file
  2. Stream large files — If you must process the file, use streaming instead of loading it entirely into memory
  3. Add download progress indicators — Show users how much has been downloaded so they know the download is working
  4. Set appropriate timeouts — Increase function timeouts for download endpoints, or bypass serverless functions entirely

Real developers can help you.

You don't need to be technical. Just describe what's wrong and a verified developer will handle the rest.

Get Help

Frequently Asked Questions

What's the maximum file size I can serve?

There's no hard limit on file size in Supabase Storage, but serverless functions typically have a 50MB response body limit and 10-30 second execution limits. Use signed URLs for files larger than a few MB.

Why do downloads work on WiFi but not mobile?

Mobile connections are slower and more prone to disconnections. Without resume support, a brief connection drop means the entire download fails and must restart.

Related Lovable Issues

Can't fix it yourself?
Real developers can help.

You don't need to be technical. Just describe what's wrong and a verified developer will handle the rest.

Get Help