Hi Jay,
I tried this way too, but I am actually getting FileNotFoundException. This
is the modified code
    String filePath = theForm.getFilePath();
    System.out.println("filePath:"+filePath);
    String fileName2 = filePath+fileName;
    System.out.println("fileName2:"+fileName2);
    //byte[] fileContent =file.getFileData();
    OutputStream bos = new FileOutputStream(new File(fileName2));
    int bytesRead = 0;
    byte[] buffer = new byte[8192];
    while ((bytesRead = stream.read(buffer, 0, 8192)) != -1) {
          bos.write(buffer, 0, bytesRead);
    }
    bos.close();

In the catch block I made SOP to print the exception and this is the output
in Tomcat console.

filePath:/upload/images/
fileName2:/upload/images/test.jpg
fnfejava.io.FileNotFoundException: \upload\images\test.jpg (The system
cannot
find the path specified)

Why is the system not able to find out the path?

Uma


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to