You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by JP...@farcomm.com on 2004/11/22 15:20:48 UTC

FileUpload into Database

I am interested in integrating some JSF controls into a webapp, 
specifically the FileUpload as the one I was using has a license 
restriction.

Does anyone have any sample code for uploading an image into a database 
using the FileUpload control and then displaying same from there?  The 
sample given in myfaces-examples.war seems incomplete (the image is being 
saved in memory only?) and I cannot find any documentation.  Should I 
download the MyFaces binaries for docs?

Thanks,

John Parker

Re: FileUpload into Database

Posted by Alecsandru Chirosca <al...@comtec.ro>.
For database operations you have to know how to work with BLOBS. 
The operations are very simple....


....
uploadedFile file;
BLOB blob;
InputStream in = file.getInputStream();
OutputStream os = blob.getBinaryStream();
.......

and you copy from in to out.

Also be carefull of database limitation issuses. Every database I worked
width has limitations but also workarounds for that.

This is all for database, 



BR 
Alecs

On Mon, 2004-11-22 at 16:20, JParker@farcomm.com wrote:

> I am interested in integrating some JSF controls into a webapp,
> specifically the FileUpload as the one I was using has a license
> restriction.
> 
> Does anyone have any sample code for uploading an image into a
> database using the FileUpload control and then displaying same from
> there?  The sample given in myfaces-examples.war seems incomplete (the
> image is being saved in memory only?) and I cannot find any
> documentation.  Should I download the MyFaces binaries for docs?
> 
> Thanks,
> 
> John Parker