title: File upload path not working in <a href="path" target="_blank"> element
body: <p>I am trying to display a file using the a href="block".</p>
  
  <p>I am using Spring MVC to upload a file.</p>
  
  <p>Following is my upload Code for HTML :-</p>
  
  <pre><code>  &lt;form method="POST" action ="uploadDocument.htm" enctype="multipart/form-data"&gt;
    Please select your resume to upload : (.pdf, .doc , .docx)&lt;br/&gt;
    &lt;input type="file" name="fileUpload" size="50" required/&gt;&lt;br/&gt;&lt;br/&gt;
    &lt;input type="submit" value="Upload"/&gt;     
    &lt;/form&gt;
  </code></pre>
  
  <p>Following is the controller code:-</p>
  
  <pre><code>@RequestMapping(value="/uploadDocument.htm", method=RequestMethod.POST)
      public String uploadFile(@RequestParam CommonsMultipartFile fileUpload,Model model,HttpServletRequest request) throws Exception{
  
  
      HttpSession session = request.getSession();
  
      UserAccount userAccount = (UserAccount)session.getAttribute("user");
  
  
          String contentType = fileUpload.getContentType();
  
          String format="";
          if(contentType.contains("pdf") || contentType.contains("vnd") || contentType.contains("msword")){
  
              if(contentType.contains("pdf")){
                  format=".pdf";
  
              }
              else if(contentType.contains("vnd")){
                  format=".docx";
  
              }
              else if(contentType.contains("msword")){
                  format = ".doc";
              }
  
              String fileName = userAccount.getUsername()+format;
  
              System.out.println(fileName);
  
              String path ="E:\\eclipse\\workspace\\Zingo_Project\\src\\main\\webapp\\fileupload\\";
  
  
              fileUpload.transferTo(new File(path+fileName)); 
  
  
              model.addAttribute(fileName);
              return "fileUploadSuccessfull";             
  
          }           
          return "uploadUserFailure";             
      }
  </code></pre>
  
  <p>I can see the file uploaded in the desired location.
  When I try to access the file in fileUploadSuccessfull.jsp. </p>
  
  <p>Following is my code of fileUploadSuccessfull.jsp.</p>
  
  <pre><code>File upload Successfull!&lt;br/&gt;
  &lt;/br&gt;
  
  &lt;a href="E:\New version\eclipse\workspace\Zingo_Project\src\main\webapp\fileupload\zingo.pdf" target="_blank"&gt;Click here to View the File&lt;/a&gt;
  </code></pre>
  
  <p>When I click on the link I cannot view the file in new Window.</p>
  
  <p>I have been stuck here for hours and I tried giving the </p>
  
  <pre><code>    href as "file:///E:/New%20version/eclipse/workspace/Zingo_Project/src/main/webapp/fileupload/zingo.pdf"
  or
  "${pageContext.request.contextPath}/fileupload/zingo.pdf"
  </code></pre>
  
  <p>Kindly help me I have been stuck here for hours.</p>
  
  <p>Thanks,
  Zingo</p>