FileNotFoundException On Oracle Web center Sites 12C

165 views Asked by At
FileInputStream inStream = new FileInputStream(new 
File(ics.GetCgi("resumeFileUpload").getFile()));

  While executing the above line we have received below Exception

        java.io.FileNotFoundException: file:\C:\Oracle\MIDDLE~1\ORACLE~1\USER_P~1\domains\MIASTA~1\servers\wcsites_server1\tmp\fwcs-tmp\temp795\dcs6083687448684979201.tmp (The filename, directory name, or volume label syntax is incorrect)
        at java.io.FileInputStream.open0(Native Method)
        at java.io.FileInputStream.open(FileInputStream.java:195)
        at java.io.FileInputStream.<init>(FileInputStream.java:138)

Please find below Environment Details Server : Weblogic 12.2.1.3.0 Java : 1.8 OS : Win 2012 R2 Orcale Webcenter Sites 12C

1

There are 1 answers

0
Graham Lynch On
 // If you want the bytes

           FTVAL bindata = ics.GetCgi("resumeFileUpload");

           if (bindata != null) {

                    bytes = bindata.getBlob();

           }



           // if you want the InputStream

           FTVAL bindata = ics.GetCgi("resumeFileUpload");

           if (bindata != null) {

                    inputStream = bindata.getStream();

           } 

Can you try the above.

This has to do with whether or not the uploaded file is over the maximum file upload size as to whether or not it gets persisted to disk so the safest way to get the InputStream is using getStream() as this will work regardless of whether it is in memory or on disk