Search code examples
node.jskeystonejs

How to Download file on frontend in KeystoneJS


I have used a local file field and full file URL not store in a database. Would you please let me know a possible way to solve this problem.

Thanks


Solution

  • There is a couple of ways to do this.

    1. Save your file in your assets folder, from where you serve your CSS and JS files and fetch it from there. OR
    2. Create an API/Route on the server which will send this file to the browser. <Check This>