1 Reply Latest reply on May 25, 2007 10:09 AM by Nasir Munir

    setting context for web application

    Nasir Munir Newbie

      short scenario:I have this application which displays list of files. I am trying to allow the users to download the files if they wish, otherwise the next step will delete the fils from the server.

      the whole picture: this is a distributive application, that allows the user to select user name and some application. They can also upload files to the server. Then the processing starts at the server side and certain files are created as output. I can display those created files through a JSP page and they are linked with a URL. The users(ideally) should be able to download them and then the rest of the steps will deal with the clean up server space(deletion of files, sending email etc).

      The problem: When I right click to choose option "save target as.." I get this error that IE cannot find the file, it is unavailable.

      My efforts so far: I have used .xml file in my server/conf/jboss.web/localhost/allow.xml to set the context, so that the user can be allowed to downlaod those files. My .xml file is :

      <?xml version='1.0' encoding='utf-8'?>
      <Context debug="99" docBase="C:/Fastran" path="\\Fastran" reloadable="true">
      </Context>
      

      I have tried modifying server.xml file as well with a helping article from JBoss site. Both of these directions didnt work. I have also tried using different versions of JBoss ie 4.0.5.Ga, 4.0.1, and 4.0.2
      My JSP page :
      <%
       String destFile = "\\Fastran\\" + applicationId.getUserEmail() + applicationId.getSessionId() + "\\ftn07_" ; %>

      and :
      <%
      
       String userFolder = applicationId.getUserEmail() + applicationId.getSessionId() ;
       for (int i = 0 ; i < Integer.parseInt(applicationId.getSpecValue()) ; i ++)
       {
       int j = i + 1 ;
       File spec = new File("C:\\Fastran\\" + userFolder + "\\ftn07_" + (i+1)) ;
      
       if (spec.exists() == true)
       {
       //out.println("") ;
      
       %>
       <a href = "<%= destFile %><%= j %>"><% out.println("ftn07_" + j); %></a><br>
       <%
       }
       else
       {
       out.println("File not found") ;
       }
      
       }
       %>
      It contains the link html tag which is used to link the files created for download.
      I am trying to resolve this issue for the last three days, and am getting frustrated now. Can I get some help, as to how to configure JBoss to allow the users to download some files through the application server ?