Page 3 of 3 FirstFirst 123
Results 21 to 27 of 27

Thread: Multipart File Upload

  1. #21

    Default

    Thanks fanfy for the explanation as it gave me a better approach to this.

    And your being verbose is good as it gave a detailed explanation

    DeepEdward

  2. #22

    Default

    Originally Posted by testing123
    I am having the same issue...and like deep says the file still get uploaded.
    Have a look at the previous posts.. thats gonna help you out..

  3. #23

    Default

    Thanks fanfy!

    I had this same problem. Your explanation was good - and the solution worked for me too.

  4. #24
    Join Date
    Jan 2009
    Posts
    1

    Default resolve

    public void fileUpload(Object command) {
    log.info("FILE UPLOAD");
    String dir = "z://FileUpload//File_Repository//";
    try {
    byte buf[] = new byte[1024 * 4];
    Portfolio bean = (Portfolio) command;

    new File(dir).mkdirs();
    log.info("Creating Directory");

    File file = new File(dir, bean.getFile().getOriginalFilename());

    FileOutputStream output = new FileOutputStream(file);
    output.write(bean.getFile().getBytes());

    try {
    InputStream input = bean.getFile().getInputStream();
    try {
    while (true) {
    int count = input.read(buf);
    if (count == -1) {
    break;
    }
    output.write(buf, 0, count);
    }
    } finally {
    input.close();
    }
    } finally {
    output.close();
    bean.setFile(null);
    }
    } catch (Exception e) {
    e.printStackTrace();
    }
    }

  5. #25
    Join Date
    Aug 2009
    Posts
    16

    Default

    Thanks!!! The suggested appraoch helped me to resolve the file (PDF) upload issue using webflow.

  6. #26
    Join Date
    Oct 2011
    Posts
    6

    Default Solved for us

    The issue was solved when we set bind="false" on transition state.

  7. #27

Posting Permissions

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