How to stop a folder uploading in NodeJS

Using Docker with a nodeJS website.
I have a directory that people upload photos to (public/assets/uploads).
When I upload a change to the live server, then it deletes the files on the live server and replaces with them with what I have locally.

I would like to some how stop the folder public/assets/uploads from uploading or being destroyed when I re-deploy to docker after making a change.

Not sure if this is even possible, if it is, could someone please explain what steps I would need to do.
I am not using the publish button (perhaps I should be)

It would be appreciated.

TIA

@Apple lol sorry was in a rush to get out to a meeting :wink: hopefully you get it now

So, I had to read your post more than 5 times to actually understand what you’re saying. I get you’re probably in a hurry, but we’re not mind readers :rofl:

The person reading your post won’t understand if you’re talking about a client uploading a file/folder to your server, or if you’re talking about your Deploy button uploading the folder and therefore overwriting what’s already on your server.

I’m going to assume you’re talking about the deployment (Deploy button).

If you’re using Docker, you could use a .dockerignore file to exclude such folder from being included in the final Docker image (unfortunately, I don’t know the exact location you should place such file)

If you’re not using Docker, someone else will help you in regards to ignoring files to be uploaded

1 Like

yep was in a bit of a rush, hopefully that reads a little better :slight_smile:

Have you defined the user uploads folder in your project settings?

1 Like

If that’s the solution, I am going to feel like an idiot for that one… ;(