Results 1 to 5 of 5

Thread: File Upload Form

  1. #1
    Join Date
    Jul 2012
    Posts
    3

    Default File Upload Form

    I have tried several options at uploading several parameters and files at the same time. So we can have parameter parts like name, description and file upload part all in one form to be handled by a single controller. spring 2.5.1 is currently in use. And I am uisng SimpleUrlMapping class with key/value mapping in the custom application context

    Code:
    <bean id="vvv" class=class="org.springframework.web.servlet.handler.SimpleUrlHandlerMapping">
       <property name="mappings">
           <props>
              <prop key="xxx">yyyy<prop>
    
    </beans>
    
    <bean id="yyyy" class="x.x.x.controller.FileUploadController>
          <property name="sss"><value>ccc</value></property>
         <property ...
         <property ...
    </bean>
    Please advise

  2. #2
    Join Date
    Jun 2006
    Location
    The Netherlands
    Posts
    13,626

    Default

    And your problem is?! And with that description include code for the FileUploadController...
    Marten Deinum
    Java Consultant / Pragmatist / Open Source Enthousiast / Author


    Pro Spring MVC: With Web Flow
    Conspect

    Have you read the reference guide.
    Use the [ code ] tags, young padawan

  3. #3
    Join Date
    Jul 2012
    Posts
    3

    Default

    Quote Originally Posted by Marten Deinum View Post
    And your problem is?! And with that description include code for the FileUploadController...
    I can create a form for file upload separately and a form for uploading parameters like name, description, etc separately. But I want to combine file upload function and submitting parameters in one form in order to submit all at the same time on clicking a submit button.

  4. #4
    Join Date
    Jun 2006
    Location
    The Netherlands
    Posts
    13,626

    Default

    Well simply create a single form including all those fields, make it a multipart form, create a form which contains the fields and a MultipartFile or byte[] for the file (I suggest the first) and you should be good to go. So as mentioned I don't see a problem (but that could be just me )...
    Marten Deinum
    Java Consultant / Pragmatist / Open Source Enthousiast / Author


    Pro Spring MVC: With Web Flow
    Conspect

    Have you read the reference guide.
    Use the [ code ] tags, young padawan

  5. #5

    Default

    I think this tutorial suits your need definitely:

    Upload files with Spring MVC (Eclipse-based tutorial)

Posting Permissions

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