InvalidFormatException:Your stream was neither an OLE2 stream, nor an OOXML stream

InvalidFormatException:Your stream was neither an OLE2 stream, nor an OOXML stream


 

背景介绍

在处理Excel文件上传的时候,出现了如下异常情况:

InvalidFormatException:Your stream was neither an OLE2 stream, nor an OOXML stream

InvalidFormatException:Your stream was neither an OLE2 stream, nor an OOXML stream

 

问题原因

从日志提示上看,是因为Excel文件格式化异常。(因为此时的Excel,是通过导出程序导出的,可能在导出的过程中,Excel的格式出现了什么异常问题。)

 

处理方案

将Excel中的数据,Copy到一个新建的Excel文件中,然后用新建的Excel文件调用上传接口,即可。

 

InvalidFormatException:Your stream was neither an OLE2 stream, nor an OOXML stream

上一篇:怎样用Google APIs和Google的应用系统进行集成(3)----调用Google 发现(Discovery)API的RESTful服务


下一篇:HBase的 rowkey 设计原则