Accessing resources(files) outside WAR application file

From: may (crp4_at_email.com)
Date: 10/21/03

  • Next message: Paul Lutus: "Re: handling focusLost Events"
    Date: 21 Oct 2003 11:00:43 -0700
    
    

    I would like to know if it is possible to access resources, e.g. image
    file, text file which reside on the application server (but not in
    war/ear files) using JSPs/servlet.

    Tasks I am trying to accomplish are:

    - User to upload file (image, text). I can do this using JSPs and
    Servlet/struts. File is uploaded on the appserver at a location
    relative to webcontext. File path is apended after obtaining
    HttpSerletRequest.getContextPath().

    - User then clicks a link to view the image/text file just uploaded in
    the previous step.

    Last step is where the problem occurs as link is trying to access
    resource which is not within its EAR/WAR file and therefore it can not
    find the file. Using HttpSerletRequest.getContextPath() returns path
    within the WAR file which is root folder of WAR file. File uploaded
    in the previous step can not be added to WAR file unless the
    application WAR file is rebuilt and redeployed. Redeploying
    application every time any user uploads a file is obviously not a
    desirable approach.

    I do not know if it is possible to access file system on application
    server outside of the web application WAR/EAR files.

    Or is redeploying application is necessary which means that it will
    need to be scheduled at an appropriate time and therefore user will
    not be able to view the web page until then.

    Any help/pointers will be much appreciated.


  • Next message: Paul Lutus: "Re: handling focusLost Events"

    Relevant Pages

    • Accessing resources(files) outside WAR application file
      ... - User to upload file ... within the WAR file which is root folder of WAR file. ... server outside of the web application WAR/EAR files. ...
      (comp.lang.java.programmer)
    • Re: File Upload - Security Issues
      ... You want to upload a file for what reason and ... these viruses have less chance of being able to execute (even if succeeded ... :> file and what pitfalls you see re: security might be helpful on this ... :>: files to an IIS server that doesn't have MS Office actually installed? ...
      (microsoft.public.scripting.vbscript)
    • Re: File Upload - Security Issues
      ... uploaded and the user could upload any or all of these in theory. ... There is no one product that can give you 100% security, ... > Code doesn't execute in local memory space unless remote user has rights ... > You don't have MS Office installed on the server. ...
      (microsoft.public.scripting.vbscript)
    • pure-ftp nologin
      ... I have a server running FreeBSD 6.3. ... # If you want to enable PAM authentication, ... AnonymousCanCreateDirs no ... # Disallow anonymous users to upload new files ...
      (comp.unix.bsd.freebsd.misc)
    • [NT] DeskNow Mail and Collaboration Server Directory Traversal Vulnerabilities
      ... The following security advisory is sent to the securiteam mailing list, and can be found at the SecuriTeam web site: http://www.securiteam.com ... Collaboration Server is "a full-featured and integrated mail and instant ... attachment upload feature that may be exploited to upload files to ... * DeskNow Mail and Collaboration Server version 2.5.12 and prior ...
      (Securiteam)