title: File Upload Path in Spring MVC
body: <p>I am a spring beginner, I am developing an application in which I am giving user option to upload Images using Apache Commons File Upload. </p>
  
  <p>I am having confusion on what should be the file upload path, My development environment is windows and application will be deployed on Linux environment.</p>
  
  <p>If I do not specify the path, Files are uploaded to the eclipse installation directory</p>
  
  <pre><code>String fileName = multipartFile.getOriginalFilename();
  inputStream = multipartFile.getInputStream();
  outputStream = new FileOutputStream(fileName);
  </code></pre>
  
  <p>I read somewhere to specify path of java.io.tmpdir in which case it is C:\Users\Tushar\AppData\Local\Temp\ for Windows</p>
  
  <pre><code>String filePath = System.getProperty("java.io.tmpdir");
  </code></pre>
  
  <p>What should be the correct approach for specifying the path such that it works on both windows and linux, in a way that I should directly be able to use the path in image tag in my jsp's </p>