I am creating a JSF application using Netbeans and i had a download folder called Snap and Files which stores the client uploaded Snaps and Files respectively but when i clean the project whole build folder gets deleted and so my files. Is there any way to prevent it from deleting some folder or any alternative.(I dont want to save it on any static path.)
Asked
Active
Viewed 708 times
1 Answers
0
You can and should not store the uploaded files in expanded WAR folder. They would in a real production environment also get lost simply because files which are added during runtime are not contained in the original WAR.
You should store them on a fixed path outside the deploy folder. There are several ways to configure the webapp to use it and to configure the server to serve files from the folder by a virtual path. See also this answer for a detailed explanation and examples: Uploaded image only available after refreshing the page