How can I upload files to my application?
I am using firebase to upload images and firebase have a specific way of doing things, that is upload a file with the certification config.
This file, of course, have sensible data. How can I upload files like this without pushing it to my project?
123 Replies
Project ID:
75f448f4-88c9-4d82-b428-61740d90e40c
75f448f4-88c9-4d82-b428-61740d90e40c
you would need to first upload the file with this - https://railway.app/template/Nan7Bs
and then move the volume over to your service
i didnt understand if i can drop a file to my folders structure
is that it?
yes, read the software's docs please - https://filebrowser.org/features
i did
but the content is not that familiar to me
how exactly do i use this?
ive deployd it
how can i paste my files and how is this used on my app?
i see that i can access this on browser
but how will the dropped file go to my app?
You will need to move the volume over to your app
so I need to create the same folder structure to drop my file?
for example
its located on src/firebase/constants
you can create whatever folder structure you want
so i need to re-create this structure to make this accessible on my app?
not unless you want to
do what works best for you
okay, and how can I move the volume to the application?
disconnect it and connect it to your app's service
isnt it possible to paste the volume on the root path?
no it is not
oh
imma do anything else then
you said it is not possible to paste the volume on root path
so i need to put it anywhere else
gotcha
so i need to change my application
i dont see why you need to
where will be this file located?
on the path, right?
wherever you uploaded it within the volume
okay, but the volume itself is on /data, right?
aint i getting this correctly?
the volume will be whereever you mount it
but i cant put this on root folder, right?
correct, nor would you want to
please read this - https://docs.railway.app/guides/volumes
will be useful thanks
it is exactly what i was saying lol
okay, now am I able to remove the filebrowser?
it still not being able to import the file
just to validate
I opened the filebrowser and dropped a file on root folder
i moved the volume on /app/secrets folder to my application
but it still not being available to access on my app.
am i forgetting something?
how do I know if the data is persisted on the volume?
am i able to deploy a different commit on my app?
have you carefully read its overview?
yes, the content is short
i'm sorry, i dont see the relevance to what i had just asked
no problem 🙂
look
oh, probably i need to put this on dist
no, it still with the same problem
it is not working...
im probably doing something wrong here
please read the template overview
i did
slow down, read it again
the template doesnt say anything, basically
it just says what the template does
yes it does, slow down, read it again
railway just crashed and its infinitly applying 3 changes
more than 5 minutes with that
applied, but it just dont work
i readed this 10 times, doesnt helped
you are skim reading it
to be clear, you should be reading this - https://railway.app/template/Nan7Bs
i did
were you talking about this part?
i was already using the root folder
but it is still not working
The rest of this post is just about what the template does
you have that variable set to what value?
1
ive already tried with 0 and 1
none of them worked
then the path you mounted the volume to or the path you are trying to read the file from is incorrect, or both
the path im trying to read is just <root>/secrets/file.json
what did you mount the volume to
/app
inside the volume i created a folder called secrets and inside of it, file.json
../.. points to root folder
^
but what is wrong with that?
you don't gain any problem solving abilities if I gave you all the simple answers
the problem is not the import, is the platform
it is not clear how to do things
and the docs dont help
if it was clear, i dont need to open a thread
this is not a platform or anything specific to the platform, this is just simple file paths and such
nothing Railway specific
so why does it work when i create the file manually but not when i use this volume stuff?
because you are doing something incorrectly
^
if i am, it is related to the volume, not to the app, the app is working correctly
the instructions to use the volumes are not clear
volume's are nothing special, it's simply a place to store files
yep
so...
i did it
and inside my volume, i created a secrets folder
it is on root, right?
if you set that variable, yes, though I haven't looked at your filebrowser service to verify if you did
so...?
its specific from railway
use a variable with a 0-1 value to set the folder
is not normal path handle
and it still dont work
that variable is specific to my filebrowser template, not railway, using correct file paths is not specific to railway either.
I recommend you read our guide again and read up on how file paths work in general.
keep trying, you will get there, and learn a new skill in the end.
we are talking about 2 things that are specific
your template and railway
a folder named /app is not specific to Railway
okay, but i've already set mine to this path
the thing is, im using a template created by u
^
... have you moved the volume over yet?
to my application? sure
let's see
i mean, that's definitely a volume, but is it the volume that was attached to the filebrowser?
yes, it is
i dont see a way to prove it, but it is
what did your app fail with
because its trying to import a file that does not exists
(the file provided by the volume)
(the file provided by you)
how can I validate if the file is on the volume?
did you put it on the volume?
yes, using the file browser
then it's on the volume
this is what i have
the appdata and lost+found came with the volume, they were not put by me
they came from the filebrowser software
yes, so i put the file into the volume, right?
well lost+found is a linux thing, but that's besides the point
right
and it proves i've used the 1 to set on root folder
yes it does
because these folders does not appear when 0 is used
so...
the file is on the expected path
right
so, it must be accessible on the application
but its not
^
look, this is my vscode
did you use nixpacks?
this works
the secrets is directly on root folder
yes, i do use nixpacks
i see something here
that must be a problem
files are not accessible during build
does it counts to reading too?
did you tell me that you needed that file during build?
i told you that my build were failing cause the file wasnt there
I get so many people using failed builds as a generic term for a crash at any stage, specifics are key
alright, how big is that file
ok, imma be more specific
2.34kb
since when are they that large?
there are keys and stuff
private keys to handshake
they are long
i tried to use envs instead, but didnt worked fine
alright we'll try to base64 encode the json, set the base64 string as a variable, and then in code decode the base64 back into a string
i can try just bypass this error during build time also
just a thought, I forget how large variables can be, I think that should fit
i dont like this strategy a lot, but its possible
why not?
bypass things can hide another problems on the future
for exemple, the file actually dont be there
oh you said you don't like your idea, try mine
your idea is to encode b64 the file and decode this on the app?
yes
2.34kb worth of data should fit into a variable, but don't quote me on that
3200 characters
of b64
see what happens, it can't hurt
if you break railway I won't hold you accountable
if my bill comes $ 1000 ill give it to you as a gift
well it's a good thing we don't bill for variables
does anyone bills for variables? haha
ima try this
I sure hope not