我用poi读excel,在window下没有问题,但把程序放到linux上时,读取客户端的excel文件报错,不知道如何解决
我用poi读excel,在window下没有问题,但把程序放到linux上时,读取客户端的excel文件报错,不知道如何解决?
错误:
C:\a.xls
You chose the file C:\a.xls.
It 's contents are: Error occurred: C:\a.xls (No such file or directory)
但在window下完全正常
我试着把c:\a.xls中的 "\ " 改为 "/ "还是不行,那位知道如何改呢,多谢
读excel的poi如下:
-------------------------------------------------------
资金文件An example of using Jakarta POI 's HSSF package to read an excel spreadsheet:
Select an Excel file to read.
String filename = request.getParameter( "xls_filename ");
out.println(filename);
if (filename != null && !filename.equals( " ")) {
%>
You chose the file .
It 's contents are:
try
{
// create a poi workbook from the excel spreadsheet file
POIFSFileSystem fs =
new POIFSFileSystem(new FileInputStream(filename));
out.println( "fs= "+fs);
HSSFWorkbook wb = new HSSFWorkbook(fs);
for (int k = 0; k < wb.getNumberOfSheets(); k++)
{
%>
Sheet