You have to create a config file, say, my-app-config.cfg.xml in which you put the path to the directory you want the uploaded files to be saved to.
the structure of your xml file should be something like this:
<my-app>
<properties>
<property name="myapp.upload-path" value="/usr/opt/myapp/" />
</properties>
</my-app>
the given path above is in unix format.
so when your application is starting up you are supposed to read the path from XML file and configure your application.
the simple way to create the config file is property files which may simply be read by Property resources
fiel name: myapp.properties
myapp.upload-path=c:/myfile/uploaded-files