Results 1 to 3 of 3

Thread: File Upload with Relative Path

  1. #1

    Post File Upload with Relative Path

    Hi. I ' m working with file uploads. In php i could manage upload to relative path with " (../upload)".
    In spring i m using
    " String absoluteFilePath = "/home/user/workspace-sts/Test/src/main/webapp/upload"; ".

    how i can manage this? When project is deployed upload will not work cause of path issue.
    I need help.

  2. #2
    Join Date
    Aug 2006
    Location
    Arequipa-Peru / South America
    Posts
    2,796

    Default

    Hello

    It is not a Spring problem. Do a research on Google about how to include an image within a JSP file. Be sure to understand too the directory structure of a Web Container for Java Web Applications like Apache Tomcat, etc
    - Manuel Jordan

    Kill Your Pride, Share Your Knowledge With All
    The Fear Of The LORD Is The Beginning Of Knowledge, But Fools Despise Wisdom And Discipline. Proverbs 1:7

    Blog


    Technical Reviewer of Apress

    • Pro SpringSource dm Server
    • Spring Enterprise Recipes: A Problem-Solution Approach
    • Spring Recipes: A Problem-Solution Approach, 2nd Edition
    • Pro Spring Integration
    • Pro Spring Batch
    • Pro Spring 3
    • Pro Spring MVC: With Web Flow
    • Pro Spring Security

  3. #3

    Default

    Problem is not to include image in jspx

    <spring:url value="/upload/${product.body}" var="image"/>
    <img id="productImage" alt="" src="${image}" />

    like that.

    in controller with
    request.getSession().getServletContext().getRealPa th("/upload")

    i get temp directory of tomcat but i wana get project path not deployed path.Because when i save uploaded file into deploy path how can i get image in jsp without doing anything in controller?


    Quote Originally Posted by dr_pompeii View Post
    Hello

    It is not a Spring problem. Do a research on Google about how to include an image within a JSP file. Be sure to understand too the directory structure of a Web Container for Java Web Applications like Apache Tomcat, etc

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •