Stop Vercel Dynamically Storing Public Files
Answered
Giant panda posted this in #help-forum
Giant pandaOP
I have a 'download' button on my app, that references a PDF file in the public directory. This works fine when run locally, however when deployed to vercel it does not.
When trying to access 'http://domain.com/FILENAME' it does not work for this file, but does work for all the other image files stored in the public folder that are used in my app.
I read that Vercel does this on purpose?
Any suggestions?
When trying to access 'http://domain.com/FILENAME' it does not work for this file, but does work for all the other image files stored in the public folder that are used in my app.
I read that Vercel does this on purpose?
Any suggestions?
Answered by Anay-208
I had to set this
"functions": {
"api/*": {
"includeFiles": "docs/**/*"
}
}
13 Replies
i faced this issue before with a app(it wasn't nextjs, so confirm), I had to add that path to vercel config. you can check out vercel config
Giant pandaOP
appreciate it - any chamnce you remember where abouts?
https://vercel.com/docs/projects/project-configuration
https://vercel.com/docs/projects/project-configuration
I had to set this
"functions": {
"api/*": {
"includeFiles": "docs/**/*"
}
}
Answer
I'm unsure if its same for nextjs.
Giant pandaOP
alright, cheers i appreciate the help
please verify if it is working first, and lmk
Giant pandaOP
Unfortunately not, as I have no severless functions I'm trying to reference,
Umm, I'll have to check this locally first. will do that tmr and let you know
Giant pandaOP
cheers
I'm able to view the PDF after deploying to vercel
@Giant panda
Giant pandaOP
Hi - so sorry for the delay, I got this woking using your help. Thank you so much!