title: How to write a file in jsp path instead of directory path?
body: <p>We have a web application hosted on WebSphere that upload images to a directory. The directory path is determined by a parameter value that is stored on database, let's say the parameter name is "dir" <code>[dir = ../images/]</code></p>
  
  <p>Where "images" folder is under the same application on WebSphere, so the system uploads the image on the folder under WebSphere</p>
  
  <p>On another page, the system retrieves the image and shows it to the user, we wanted the system to read images from database instead of reading it from physical directory. When the system tries to access the image <code>[id: img123.jpg]</code>, the system automatically sets the image path to be <code>[dir + imgid -&gt; ../images/img123.jpg]</code></p>
  
  <p>So we changed the dir parameter value to be <code>[dir = ../images/img.jsp?]</code>
   which automatically made the system to open the image from path <code>[../images/img.jsp?img123.jpg]</code> and it worked correctly in reading the image on the webpage as the jsp responds with image bytes stored on database</p>
  
  <p>But now we are not able to write the file as the system tries to write the file to the path <code>[../images/img.jsp?]</code> which will not work.</p>
  
  <p>Do you have any solution to this, or any other suggestions on how to achieve this without making changes to the system itself?</p>