How to change default upload path?

Hello, I use Docker to deploy Strapi, and after each redeploy, media files become corrupted. I guess it is because media files are stored in the file system, and when a new container starts, they are being removed. Is there a way to change the default path where files are uploaded instead of /public/uploads? Or how do I make it work with Docker?

Unfortunately, there doesn’t seem to be a built-in way to set where the files will be uploaded to. I’m in the process of writing a provider that will do just that.

You can however try strapi-provider-upload-local-extra that ostensibly allows you to set a target upload folder other than the default.

plugin doesn’t work, after specifying path for example uploads/${params.hash}.${params.ext} it creates uploads folder under derictory with name undefined in root of the project

I also have the need to upload media files in custom folders inside the Media Gallery. Is there a way to do it using this plugin? I see the documentation is few.

Best is to create your own API endpoint that accepts and saves files. The upload plugin for sensitive data is quite useless.