I have created a volume but it does not seem like my files are saving to it

I have created a volume in my app but I do not think anything is being save to it if I upload a photo it is there for about five minutes then it is deleted. The volume that was created has attached to the machine and says that I have used 178 mb when I try to upload more files the storage amount stays at 178 mb. Also when i run

/home/vboxuser/.fly/bin/fly ssh console

i dont see anything which makes me wonder what the 178mbs are shouldn’t this show the contents of the volume?

I have this in my fly.toml file

and when I run my api locally the files that i upload are saved to the /uploads directory which in the route of my project.

What is WORKDIR in your Dockerfile? What you likely want is /uploads inside this directory. For example, if WORKDIR is /app, you want destination="/app/uploads" in your fly.toml.

Yeah it is /app ill try to change it thanks

Yeah that was it it is working now.

Do you know if fs.unlink works to delete from the volume?
fs.unlink(“./uploads/” + picPost.image, (err) => {

Seems to work

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