Simplified file retrieval from Vercel Sandbox environments
Vercel Sandbox SDK adds two file retrieval methods, downloadFile() and readFileToBuffer(), to simplify extracting generated files from isolated VMs without manual stream handling.
The now includes two new methods that make file retrieval simple.Vercel Sandbox SDK When you run code in a , that code can generate files like a CSV report, a processed image, or a PDF invoice. These files are created inside isolated VMs, so they need to be retrieved across a network boundary. Until now, this required manual stream handling with custom piping.Vercel Sandbox If you want to download a generated report from your sandbox to your local machine, you can use to seamlessly stream the contents.downloadFile() Both methods handle the underlying stream operations automatically.
For example, if your sandbox runs a script that generates a chart as a PNG, you can pull it out with a single call to , no manual stream wiring needed.readFileToBuffer() Learn more about the or explore the updated .Sandbox SDKdocumentation Read more Download a file Read file contents to buffer