【问题标题】:FileNotFoundException On Oracle Web center Sites 12COracle Web 中心站点 12C 上的 FileNotFoundException
【发布时间】:2018-12-14 18:01:19
【问题描述】:
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)

请在下面找到环境详细信息 服务器:Weblogic 12.2.1.3.0 爪哇:1.8 操作系统:Win 2012 R2 Orcale Webcenter 站点 12C

【问题讨论】:

  • 这种情况什么时候发生?
  • 我们有一个包含一些字段并上传文件的表单。我们已经提交了表单,我们正在尝试使用下面的代码读取文件,我们收到了 Exception FileInputStream inStream = new FileInputStream(new File(ics.GetCgi("resumeFileUpload").getFile()));

标签: java webcenter webcenter-sites


【解决方案1】:
 // 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();

           } 

你可以试试上面的。

这与上传的文件是否超过最大文件上传大小以及它是否被持久化到磁盘有关,因此获取 InputStream 的最安全方法是使用 getStream(),因为无论无论是在内存中还是在磁盘上

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2020-07-31
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2014-03-14
    • 1970-01-01
    相关资源
    最近更新 更多