R
Railwayβ€’17mo ago
Nico

How to download files from a volume

Looking for ways in which I can download the files in a volume.
27 Replies
Percy
Percyβ€’17mo ago
Project ID: N/A
Nico
NicoOPβ€’17mo ago
N/A
Brody
Brodyβ€’17mo ago
okay so what kind of app are you running
Nico
NicoOPβ€’17mo ago
A node.js app using express
Brody
Brodyβ€’17mo ago
and what kind of files are you looking to get from the volume
Nico
NicoOPβ€’17mo ago
they will range from images to CAD files such as the .stl file format
Brody
Brodyβ€’17mo ago
wouldnt those best be served by an api endpoint in your node app?
Nico
NicoOPβ€’17mo ago
do you mean having a filestore using a different service and connecting into that? Maybe I misunderstood the use of the volume
Brody
Brodyβ€’17mo ago
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
Nico
NicoOPβ€’17mo ago
Oh I see what you mean So if I do that, I would still be connecting into the set up volume, correct?
Brody
Brodyβ€’17mo ago
how did these files get onto the volume
Nico
NicoOPβ€’17mo ago
via a POST request + RAILWAY_VOLUME_MOUNT_PATH I sent the files with busboy
Brody
Brodyβ€’17mo ago
so wouldn't it make sence to setup a GET endpoint that returns the desrired file?
Nico
NicoOPβ€’17mo ago
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
Brody
Brodyβ€’17mo ago
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
Nico
NicoOPβ€’17mo ago
Gotcha
Brody
Brodyβ€’17mo ago
it was meant for people who want to grab their sqlite database off of the volume, not so much as a file server
Nico
NicoOPβ€’17mo ago
understood What if I wanted to delete a file?
Brody
Brodyβ€’17mo ago
my template only allows you to download and browse, anything else you would need to build into your app
Nico
NicoOPβ€’17mo ago
Ok, gotcha.
Nico
NicoOPβ€’17mo ago
DELETE - HTTP | MDN
The HTTP DELETE request method deletes the specified resource.
Nico
NicoOPβ€’17mo ago
Which I never have but can figure it out
Brody
Brodyβ€’17mo ago
i was just gonna mention that
Nico
NicoOPβ€’17mo ago
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...
Brody
Brodyβ€’17mo ago
yes you are, thats exactly one of the intended use cases
Nico
NicoOPβ€’17mo ago
Copy that Thanks for the help! Have a good evening
Brody
Brodyβ€’17mo ago
happy to help! and to you as well πŸ™‚
Want results from more Discord servers?
Add your server