automatically deleted files

I deployed an application in Nodejs and I have a function to upload files to the server using multer, when I upload them it saves them correctly but after a few seconds it deletes the files that were uploaded, any solution? thank you

I use nodejs, multer for files,

We forum users could help more if we knew more about your configuration…

For example, the number of Machines you have running, their RAM sizes, and what storage approach was taken.

Also, could you post your initialization code? E.g., multer({dest: "unsynchronized-uploads/"}).

im running this

and this is the multer code

const multer = require(‘multer’);
const storage = multer.diskStorage({
destination: function (req, file, cb) {
cb(null, ‘/app/docs/’) // Directorio donde se guardarán los archivos
filename: function (req, file, cb) {
cb(null, file.originalname) // Nombre original del archivo
const upload = multer({ storage: storage });

What’s likely happening is that you have the following in your fly.toml:

  auto_stop_machines = true
  auto_start_machines = true

This will stop the machine when idle, and restart the machine fresh when a new request comes in.

If you want the data to persist, you need to use a volume:

1 Like

thanks, it works now

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