You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@poi.apache.org by "Kohan, Massoud" <mk...@hr.ubc.ca> on 2003/02/21 18:48:12 UTC

POIFSFileSystem error

I would like create a jsp that opens up a new excel spreadsheet and users past their excel data over it, and the  jsp would  be able to read the excel. When run the jsp I got this error:

java.io.IOException: Unable to read entire header; 5 bytes read; expected 512 bytes at org.apache.poi.poifs.storage.HeaderBlockReader.(HeaderBlockReader.java:114) at org.apache.poi.poifs.filesystem.POIFSFileSystem.(POIFSFileSystem.java:120) at
org.apache.jsp.read_0005fexcelFile

My partial code are:

            String fileURL = "http://www.jobpostings.hr.ubc.ca/jsp/excel3.xls";
	 URL url = new URL ( fileURL ); 
		  
	POIFSFileSystem fs      = new POIFSFileSystem(url.openStream());
	HSSFWorkbook wb = new HSSFWorkbook(fs);
           HSSFSheet sheet = wb.getSheetAt(0); 

Massoud
 

Re: POIFSFileSystem error

Posted by Avik Sengupta <av...@apache.org>.
maybe this will help?
http://nagoya.apache.org/bugzilla/show_bug.cgi?id=13478

Workaround is to either read your file from disk, or use the
blockingstream from the bug report. 


On Fri, 2003-02-21 at 23:18, Kohan, Massoud wrote:
> I would like create a jsp that opens up a new excel spreadsheet and users past their excel data over it, and the  jsp would  be able to read the excel. When run the jsp I got this error:
> 
> java.io.IOException: Unable to read entire header; 5 bytes read; expected 512 bytes at org.apache.poi.poifs.storage.HeaderBlockReader.(HeaderBlockReader.java:114) at org.apache.poi.poifs.filesystem.POIFSFileSystem.(POIFSFileSystem.java:120) at
> org.apache.jsp.read_0005fexcelFile
> 
> My partial code are:
> 
>             String fileURL = "http://www.jobpostings.hr.ubc.ca/jsp/excel3.xls";
> 	 URL url = new URL ( fileURL ); 
> 		  
> 	POIFSFileSystem fs      = new POIFSFileSystem(url.openStream());
> 	HSSFWorkbook wb = new HSSFWorkbook(fs);
>            HSSFSheet sheet = wb.getSheetAt(0); 
> 
> Massoud
>  
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: poi-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: poi-user-help@jakarta.apache.org
> 




Re: POIFSFileSystem error

Posted by bindu mahadev <bi...@yahoo.com>.
Even i am getting the same error,I am doing the same
thing in JSP...
When i run the example ReadWriteWorkbook I am getting
FileNotfound exception in the main...
did you test the example?

Bindu
--- "Kohan, Massoud" <mk...@hr.ubc.ca> wrote:
> I would like create a jsp that opens up a new excel
> spreadsheet and users past their excel data over it,
> and the  jsp would  be able to read the excel. When
> run the jsp I got this error:
> 
> java.io.IOException: Unable to read entire header; 5
> bytes read; expected 512 bytes at
>
org.apache.poi.poifs.storage.HeaderBlockReader.(HeaderBlockReader.java:114)
> at
>
org.apache.poi.poifs.filesystem.POIFSFileSystem.(POIFSFileSystem.java:120)
> at
> org.apache.jsp.read_0005fexcelFile
> 
> My partial code are:
> 
>             String fileURL =
> "http://www.jobpostings.hr.ubc.ca/jsp/excel3.xls";
> 	 URL url = new URL ( fileURL ); 
> 		  
> 	POIFSFileSystem fs      = new
> POIFSFileSystem(url.openStream());
> 	HSSFWorkbook wb = new HSSFWorkbook(fs);
>            HSSFSheet sheet = wb.getSheetAt(0); 
> 
> Massoud
>  
> 
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> poi-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail:
> poi-user-help@jakarta.apache.org
> 


__________________________________________________
Do you Yahoo!?
Yahoo! Tax Center - forms, calculators, tips, more
http://taxes.yahoo.com/