Announcement Announcement Module
Collapse
No announcement yet.
File Upload Form Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • 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
    And your problem is?! And with that description include code for the FileUploadController...

    Comment


    • #3
      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.

      Comment


      • #4
        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 )...

        Comment


        • #5
          I think this tutorial suits your need definitely:

          Upload files with Spring MVC (Eclipse-based tutorial)

          Comment

          Working...
          X