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

  • Multiple File upload

    Hello everyone,

    I amtrying to realize a multiple fileupload with webflow. With multiple i actualy mean multiple files and not multipart files.

    The problem i am having is that i want the user to set the number of files he wants to upload. so i dont really know how to do the binding with the Model.

    My Model bean looks like this:
    Code:
    public class MyBean implements Serializable {
     private byte[] fileContent;
     private String fileContentType;
      private String originalFileName;
     
     // getters and setters for filecontent, fileCOntentType, originalFileName
    
      public void setFile(MultipartFile file) {
        this.fileContent = file.getBytes();
        this.fileContentType = file.getContentType();
        this.originalFileName = file.getOriginalFileName();
      }  
    }
    The model Attribut of the View is an Array of these Beans.

    I have no clue how to do the binding in that array.

    I tried it like this which isnt working:

    Code:
    <form:form  modelAttribute="MultiDocs" method="post" enctype="multipart/form-data">	
    	<input type="file" name="${MultiDocs}[0].file"/>
            <input type="file" name="${MultiDocs}[1].file"/>
            <input type="file" name="${MultiDocs}[2].file"/>
            <input type="file" name="${MultiDocs}[3].file"/>
    	<input type="submit" name="_eventId_saveFile" value="File auswählen" />
    </form:form>
    and even if it would work i would rather have the user to choose how many files he wants to upload at one time.

    Does anyone have some hints for me concerning the model-binding and maybe even how to do it in a variable way so useres can decide about the number of documents to upload?

    Thx a lot in advance for any hints you guys can share!

  • #2
    hi,
    have you resolve this problem ?

    Comment

    Working...
    X