How to download files from a volume
Looking for ways in which I can download the files in a volume.
27 Replies
Project ID:
N/A
N/A
okay so what kind of app are you running
A node.js app
using express
and what kind of files are you looking to get from the volume
they will range from images to CAD files such as the .stl file format
wouldnt those best be served by an api endpoint in your node app?
do you mean having a filestore using a different service and connecting into that?
Maybe I misunderstood the use of the volume
no that wouldn't be possible, you can only attach one volume to one service at a time, this is why the downloading files off of the volume needs to be done by the service the volume is attached to
Oh I see what you mean
So if I do that, I would still be connecting into the set up volume, correct?
how did these files get onto the volume
via a POST request + RAILWAY_VOLUME_MOUNT_PATH
I sent the files with busboy
so wouldn't it make sence to setup a GET endpoint that returns the desrired file?
I could do that, thanks
If I didnt want to add anything on my end, is your file download app a good alternative?
https://railway.app/template/guiCBv
well no, not really, it requires you remove the volume from the original service and add it to the file browser service, since you can only mount a volume to one service at a time
Gotcha
it was meant for people who want to grab their sqlite database off of the volume, not so much as a file server
understood
What if I wanted to delete a file?
my template only allows you to download and browse, anything else you would need to build into your app
Ok, gotcha.
Yeah I guess I would need to use https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods/DELETE
DELETE - HTTP | MDN
The HTTP DELETE request method deletes the specified
resource.
Which I never have but can figure it out
i was just gonna mention that
Last question
Am I using the volume correctly? Is it meant for this type of data or, for example, as a file store for persistent data on the site?
I am looking to have users keep adding data...
yes you are, thats exactly one of the intended use cases
Copy that
Thanks for the help! Have a good evening
happy to help! and to you as well π