Hi, users of cocoon.
My name is Hugo Marcelino and i came across with the following problem. I'm
developing a web application that can perform a documental managment. How i'm doing
this ? I thougth use hsqldb that comes with the cocoon, and at the begining everthing
was going ok. But now i have the following problem. I need to upload the content of a
file, that can be any kind of file, into the database. The field in the database is
binary and i discover that binary files only suport hexadecimal caracters and then i
need to perform a download ( using http ) file from the database into the localdisk.
Now, how do i trigger a download from the database into the localdisk ?
And does anyone have any algorithm on how to transform the content of the file using
xsp to insert into the database ?
Because i believe that something is wrong with mine. (i read the content of the file
and transform into hexadecimal caracters)
/* fiile reading and hexadecimal transformation*/
String pathfile = "d:\\tempfile.doc";
FileInputStream upload = new FileInputStream (pathfile);
int len = upload.available();
byte contentFile[] = new byte[len];
upload.read(contentFile);
StringBuffer hexFile = new StringBuffer();
for (int i = 0; i < contentFile.length; i++) {
temp = (int)contentFile[i];
hexFile.append(Integer.toHexString(temp));
}*/
upload.close();
String filename =
pathfile.substring(pathfile.lastIndexOf(File.separatorChar)+1,pathfile.length());
thank you in advance .
Hugo Marcelino
25-06-2004
___________________________________________________________________________________________
IOL - Portal Oficial do 10� Festival Super Bock Super Rock.
Ouve a R�dio do Festival no Cotonete!
http://www.cotonete.iol.pt/quiosque/destaques/sbsr04
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]