Upload with incorrect encoding
Hi, I have a little problem (I'm not sure, if it is problem of cocoon or pure java - if so, I apologize :). When I want to store into database binary data of uploaded file, many of characters are replaced by '?'. When I tried to store data to the file, everything was ok (it means, that from InputStream are going out relative correct characters). It looks like, that problem comes on by assigning of InputStream data to the String (I tried InputStreamReader with correct encoding also) and following storing into database for this reason fails. What have I to do differently? Thanx a lot! osup - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Upload with incorrect encoding
Doesn't your database support the blob fieldtype? I am not sure why you store the inputstream in a string first. > Hi, I have a little problem (I'm not sure, if it is problem of cocoon or > pure > java - if so, I apologize :). When I want to store into database binary > data of > uploaded file, many of characters are replaced by '?'. When I tried to > store > data to the file, everything was ok (it means, that from InputStream are > going > out relative correct characters). It looks like, that problem comes on by > assigning of InputStream data to the String (I tried InputStreamReader > with > correct encoding also) and following storing into database for this reason > fails. > > What have I to do differently? Thanx a lot! > > osup > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Upload with incorrect encoding
Db supports BLOBs, but I never did anything with them in java, less so cocoon :) Is it possible to use ESQL someways? Probably not, isn't it :) osup Cituji z emailu od Jorg Heymans <[EMAIL PROTECTED]>: > Doesn't your database support the blob fieldtype? I am not sure why you > store the inputstream in a string first. > > > Hi, I have a little problem (I'm not sure, if it is problem of cocoon or > > pure > > java - if so, I apologize :). When I want to store into database binary > > data of > > uploaded file, many of characters are replaced by '?'. When I tried to > > store > > data to the file, everything was ok (it means, that from InputStream are > > going > > out relative correct characters). It looks like, that problem comes on by > > assigning of InputStream data to the String (I tried InputStreamReader > > with > > correct encoding also) and following storing into database for this > reason > > fails. > > > > What have I to do differently? Thanx a lot! > > > > osup > > > > - > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > For additional commands, e-mail: [EMAIL PROTECTED] > > > > > > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Upload with incorrect encoding
so you would need 1) action to retrieve uploaded file from the request (there are loads of examples on the wiki and mailinglist) 2) inside the action you would upload it into the database using sth like stmnt.setBytes(1, blobBytes) where blobBytes is a byte array with your file data. Retrieving the data should be very similar, check your jdbc docs for specifics. Hope this helps Jorg > Db supports BLOBs, but I never did anything with them in java, less so > cocoon :) Is it possible to use ESQL someways? Probably not, isn't it :) > > osup > > Cituji z emailu od Jorg Heymans <[EMAIL PROTECTED]>: > >> Doesn't your database support the blob fieldtype? I am not sure why you >> store the inputstream in a string first. >> >> > Hi, I have a little problem (I'm not sure, if it is problem of cocoon >> or >> > pure >> > java - if so, I apologize :). When I want to store into database >> binary >> > data of >> > uploaded file, many of characters are replaced by '?'. When I tried to >> > store >> > data to the file, everything was ok (it means, that from InputStream >> are >> > going >> > out relative correct characters). It looks like, that problem comes on >> by >> > assigning of InputStream data to the String (I tried InputStreamReader >> > with >> > correct encoding also) and following storing into database for this >> reason >> > fails. >> > >> > What have I to do differently? Thanx a lot! >> > >> > osup >> > >> > - >> > To unsubscribe, e-mail: [EMAIL PROTECTED] >> > For additional commands, e-mail: [EMAIL PROTECTED] >> > >> > >> >> >> - >> To unsubscribe, e-mail: [EMAIL PROTECTED] >> For additional commands, e-mail: [EMAIL PROTECTED] >> > > > > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Upload with incorrect encoding
[EMAIL PROTECTED] wrote: Db supports BLOBs, but I never did anything with them in java, less so cocoon :) Is it possible to use ESQL someways? Probably not, isn't it :) ESQL and (modular) database actions support blob, clob types. AFAIR ESQL can only get them while the actions can insert and update them. Chris. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Upload with incorrect encoding
Christian Haul wrote: [EMAIL PROTECTED] wrote: Db supports BLOBs, but I never did anything with them in java, less so cocoon :) Is it possible to use ESQL someways? Probably not, isn't it :) ESQL and (modular) database actions support blob, clob types. AFAIR ESQL can only get them while the actions can insert and update them. And there's an example of configuring the modular database actions (mod-db) to accept an uploaded file directly into a db blob. No code - just configuration. It's in the database block examples. Geoff - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Upload with incorrect encoding
Thanks for your answer. But I'd like to ask, if is possible to do it inside XSP script. I need to do much more stuff with the data of the upload form (another inserts, logic etc.) then just storing the file into db. I know, that it could I do with action too, but it's not as comfortable and straightforward as in XSP, I think. Thanx. osup > so you would need > 1) action to retrieve uploaded file from the request (there are loads of > examples on the wiki and mailinglist) > 2) inside the action you would upload it into the database using sth like > stmnt.setBytes(1, blobBytes) where blobBytes is a byte array with your > file data. > Retrieving the data should be very similar, check your jdbc docs for > specifics. > > Hope this helps > Jorg > > > Db supports BLOBs, but I never did anything with them in java, less so > > cocoon :) Is it possible to use ESQL someways? Probably not, isn't it :) > > > > osup > > > > Cituji z emailu od Jorg Heymans <[EMAIL PROTECTED]>: > > > >> Doesn't your database support the blob fieldtype? I am not sure why you > >> store the inputstream in a string first. > >> > >> > Hi, I have a little problem (I'm not sure, if it is problem of cocoon > >> or > >> > pure > >> > java - if so, I apologize :). When I want to store into database > >> binary > >> > data of > >> > uploaded file, many of characters are replaced by '?'. When I tried to > >> > store > >> > data to the file, everything was ok (it means, that from InputStream > >> are > >> > going > >> > out relative correct characters). It looks like, that problem comes on > >> by > >> > assigning of InputStream data to the String (I tried InputStreamReader > >> > with > >> > correct encoding also) and following storing into database for this > >> reason > >> > fails. > >> > > >> > What have I to do differently? Thanx a lot! > >> > > >> > osup > >> > > >> > - > >> > To unsubscribe, e-mail: [EMAIL PROTECTED] > >> > For additional commands, e-mail: [EMAIL PROTECTED] > >> > > >> > > >> > >> > >> - > >> To unsubscribe, e-mail: [EMAIL PROTECTED] > >> For additional commands, e-mail: [EMAIL PROTECTED] > >> > > > > > > > > > > - > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > For additional commands, e-mail: [EMAIL PROTECTED] > > > > > > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]