Volumen
Hi I'm trying to use Volumes here are some picks one is about my project and the other is about the variables I use. This is my code:
import { Router } from "express";
import {
crearPDFURL,
descargarPDF,
actualizarPDFURL,
eliminarLink
} from "../controllers/pdf_url.controller.js";
import multer from "multer";
import { nanoid } from "nanoid";
const volumeName = process.env.RAILWAY_VOLUME_MOUNT_PATH;
const storage = multer.diskStorage({
destination:
${volumeName}
, // where files must be located
filename: (req, file, cb) => {
// Generates a randome name
const uniqueFileName = nanoid() + "-" + file.originalname;
cb(null, uniqueFileName.slice(0, 255)); // Limita el nombre de archivo a 255 caracteres
},
});
const upload = multer({ storage });
I upload the file but I can't see it on the engine-disk or "Volume". Thanks for the help.5 Replies
Project ID:
N/A
N/A
railway doesnt provide any way to see the files on the volume, all file access must be done by the service its attached to, but here is an example CRUD-ish app with multer, express, and a railway volume
https://github.com/brody192/multer-file-uploads
btw you should not be setting those two service variables yourself, railway sets them for you behind the scenes
Thanks!!!
no problem 🙂