Simplified file retrieval from Vercel Sandbox environments
By Steven Van ·
Two new SDK methods, downloadFile() and readFileToBuffer(), replace manual stream piping for pulling files out of a sandbox.
The Vercel Sandbox SDK adds two methods for pulling files out of a sandbox, downloadFile() and readFileToBuffer(). Code running in a sandbox can generate files such as a CSV report, a processed image, or a PDF invoice, but since they're created inside an isolated VM, retrieving them previously required manual stream handling with custom piping.
- downloadFile() streams a file from the sandbox to a local destination path, resolving to that path (or null if the source file doesn't exist).
- readFileToBuffer() reads a file's contents directly into a buffer, useful for something like pulling a generated chart PNG out with a single call.
Both methods handle the underlying stream operations automatically, replacing the manual piping the SDK previously required. See the SDK reference for details.
Vercel
The platform for frontend developers — deploy, preview, and scale web apps and AI agents with zero config.
View Vercel →