Gerhard

I think that your problem is not mysql but the use of the
DatabaseAddAction.
Looking through the source for the DatabaseAddAction indicates no
awareness of Uploaded Files.
The error you are receiving below shows that cocoon is correctly
retrieving your file and placing it in a FilePartFile object but the
DatabaseAddAction is retrieving the data through request.getParameter()
which only returns a string showing you the toString() results of the
FilePartFile object.
If you handle the database work in your own action you will have no
problem adding the binary data (Correction: using mysql's default
limits, you will only be able to store 1M of information (Change
max_allowed_packet if you need more)).

You should be able to write a small action which reads the FilePart and
places the actual file into a request Attribute.
I refer to the setColumn method in AbstractDatabaseAction which looks
for form elements in the following sequence:
<snip>
Object value = request.getParameter(param);
if (value == null) value = request.getAttribute(param);
if (value == null) value = request.get(param);
</snip>
Here it will locate the uploaded file through the getParameter so it
won't keep checking.
I would use a different name for the form field than actually used in my
HTML form and then I would read the FilePart in my own action saving the
File into a request attribute using the field name specified to the
DatabaseAddAction which will cause the DatabaseAddAction to find the
File in the request.getAttribute in the code above.

I hope this helps a little.

Andrew

On Thu, 2002-06-06 at 01:31, Gerhard Hipfinger wrote:
> Hi!
> 
> Has anyone successfully configured mysql to store binary data in blob 
> fields?
> 
> As soon as I try to upload e. g. an image I get an
> _org.apache.cocoon.ProcessingException:
> Could not add record: java.io.FileNotFoundException:
> org.apache.cocoon.components.request.multipart.FilePartFile@2bfa91
> (Datei oder Verzeichnis nicht gefunden)_
> 
> The file itself is correctly uploaded in the upload-dir
> 
> I used the howto from
> http://marc.theaimsgroup.com/?l=xml-cocoon-users&m=101468178609584&w=2
> but only getting the error above.
> 
> Anyone out there who can confirm mysql troubles?
> 
> Regards,
> Gerhard
> 
> 
> ---------------------------------------------------------------------
> Please check that your question has not already been answered in the
> FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>
> 
> To unsubscribe, e-mail: <[EMAIL PROTECTED]>
> For additional commands, e-mail: <[EMAIL PROTECTED]>
> 
> 



---------------------------------------------------------------------
Please check that your question has not already been answered in the
FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>

To unsubscribe, e-mail: <[EMAIL PROTECTED]>
For additional commands, e-mail: <[EMAIL PROTECTED]>

Reply via email to