0
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

Cœur
  • 37,241
  • 25
  • 195
  • 267
ssantug
  • 11
  • 4
  • When does this occur? – Jonathan Hult Jul 06 '18 at 13:01
  • We have a form that contains some fields and to upload a file. we have submitted the form and we were trying to read the file using below code we have received that Exception FileInputStream inStream = new FileInputStream(new File(ics.GetCgi("resumeFileUpload").getFile())); – ssantug Jul 09 '18 at 09:07

1 Answers1

0
 // 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