cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Askild Aaberg Olsen <ask...@xangeli.com>
Subject Re: Upload File to SQL-Database
Date Mon, 07 Nov 2005 12:50:35 GMT
Moritz Kobel wrote:

>Hi all,
>
>what's the best way to upload a file to a sql-database?
>
>Is it a good way to use the example on
>http://wiki.apache.org/cocoon/FileUploadsWithFlow as base and 
>change the upload function to store the filecontent in a database?
>
>Are there any working solutions available?
>
>  
>
Your question adresses two different isses: One for file-upload, and one 
for storing this (or any other) file in a sql-database. There are 
several different solutions in Cocoon for both of them, but this is how 
we insert binary data into an sql-database, using the DatabaseUpdateAction:

<?xml version="1.0" encoding="UTF-8"?>
<root>
    <connection>xdb</connection>
    <table name="xblob">
        <keys>
            <key param="id" dbcol="id" type="string"/>
        </keys>
        <values>
            <value param="<uri-for-file-content>" dbcol="xdata" 
type="binary"/>
        </values>
    </table>
</root>

Using a pure flow-based method would also work.

Askild
-

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Mime
View raw message