provide a POST route which responds with an "application/zip" content type which results in the download of a zip file.
The zip file could be 10MB or 50MB.
I cannot allow the end-user in any way to understand what the true URL of the zip file is, so we're acting as a proxy.
We do not want to download the file to the local file-system.
Challenges: * I'm not sure what the max Vercel |(or Next.js) would allow a response to take * Proxying a req will pump up memory usage * Not sure what the cost implication may be for bandwidth * Once file download has completed ideally I'd persist a record to DB/Supabase
Has anyone had to do anything similar? Has anyone got any suggestions on how to do this?
Any help would be greatly appreciated!
https://stackoverflow.com/questions/68490546/how-to-download-a-file-on-next-js-using-an-api-route (frontrunner, see first answer) https://stackoverflow.com/questions/20351637/how-to-create-a-simple-http-proxy-in-node-js