Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > web application load xls file ?

Reply
Thread Tools

web application load xls file ?

 
 
tomo
Guest
Posts: n/a
 
      04-23-2010
I have a web application, and I want to load a xls file from db (blob). How
can i do it, without using something like File file = new File(C:\...)...
Only restriction is that I can't use some hardcoded folder(for example
c:\file) to create let's say a new xls. file, it has to be some temp file on
server ?



__________ Information from ESET NOD32 Antivirus, version of virus signature database 5052 (20100423) __________

The message was checked by ESET NOD32 Antivirus.

http://www.eset.com




 
Reply With Quote
 
 
 
 
Lew
Guest
Posts: n/a
 
      04-23-2010
tomo wrote:
> I have a web application, and I want to load a xls file from db (blob). How
> can i [sic] do it, without using something like File file = new File(C:\...)...
> Only restriction is that I can't use some hardcoded folder(for example
> c:\file) to create let's say a new xls. file, it has to be some temp file on
> server ?
>


It needn't be any kind of file anywhere, given that it's already a
file in the DB, from what you tell us.

BLOBs map to 'byte[]' and can be accessed via 'InputStream'.
<http://java.sun.com/javase/6/docs/api/java/sql/
Blob.html#getBinaryStream()>

You probably want Apache POI.
<http://poi.apache.org/>
<http://poi.apache.org/spreadsheet/index.html>

It has ways to create an XLS document from 'InputStream'.

<http://poi.apache.org/apidocs/org/ap...ssf/usermodel/
XSSFWorkbook.html#XSSFWorkbook(java.io.InputStream )>
<http://poi.apache.org/apidocs/org/ap.../ss/usermodel/
WorkbookFactory.html#create(java.io.InputStream)>

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
XLS to web ? john Java 0 10-05-2010 05:26 PM
downloading .xls files from the web Fonzie ASP .Net 2 02-08-2007 02:16 AM
How to convert a .txt file extension to a .xls file extension? Steve ASP .Net 3 08-25-2006 05:43 PM
can we access more than one xml file from one single xls file. sachin XML 1 12-01-2005 09:56 AM
Securing attachments,e.g., .pdf, .doc, .xls through web.config win2kcowboy ASP General 1 05-25-2005 07:57 PM



Advertisments