Build process clean uploaded files #3917
-
Hi, I've configured the driver to store my user uploaded files on the 'storage' folder in root of the project. The problem is, when I do a build process it cleans the folder. So if I start in production, receive files and then do an update and a new build, my uploaded files are cleaned, how can I deal with this? And there is a problem to run production without build? Only using |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 1 reply
-
Hello, You've juste to store files in another folder, like this in {
root: Application.inProduction
? Env.get('DRIVE_ROOT') + '/storage/uploads'
: Application.tmpPath('uploads'),
} |
Beta Was this translation helpful? Give feedback.
-
Yup, that is a very common thing. All you have do is keep the uploaded files on the server outside of the project root. And use an environment variable to switch the paths between local and prod. |
Beta Was this translation helpful? Give feedback.
-
Thank you both. The solution worked :) |
Beta Was this translation helpful? Give feedback.
Yup, that is a very common thing. All you have do is keep the uploaded files on the server outside of the project root. And use an environment variable to switch the paths between local and prod.