How to save file in Disks

Hello, I’m a newbie. I’ve deployed a Node.js project, and the repository looks like this:

  • folderPDF (for storing PDF files)
  • server.js
  • .gitignore
  • package.json
  • package-lock.json

In server.js, there’s an API for generating PDF files and storing them in the folderPDF directory.

My question is, should the Mount Path be /folderPDF, or do I need to edit my code for doc.pipe(fs.createWriteStream(path.join(__dirname, ‘folderPDF’, ‘test.pdf’)));


The “Mount Path” specified on a Render Disk is relative to the root of the filesystem, not to your code or anywhere else.

If you set a “Mount Path” of /folderPDF (also be aware that Linux has a case-sensitive filesystem) then you would write files to /folderPDF directly, it wouldn’t need to be joined.


This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.