I'm developing a small Java application using Spring MVC. I want to store profile pictures por users, but I don't know where to store it so I can serve it later to the users.
I have read this articles:
What does servletcontext.getRealPath(“/”) mean and when should I use it
Recommended way to save uploaded files in a servlet application
But I think I'm missing something. In the second article the accepted answer says that the recommended way to go is hardcoding a path in your system, like C:/webapps/uploads
but is this the best way to go? If you run your application in a different OS this is not going to work right? There is no way to store your images for example in some path like the webapp resources folder?