Problem eith Form-Field of type "file"

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Problem eith Form-Field of type "file"

Alexander1893
Hi all,

I want to add a new imageDataResource using the Service createImageDataResource.

I'm using the following form:

 <form type="single" name="singleFileUpload" target="performSingleFileUpload">
    <field tooltip="I'm a tooltip" name="imageData" title="Select Image:"><file/></field>
    <field name="submitButton" title="${uiLabelMap.CommonAdd}" widget-style="smallSubmit"><submit button-type="button"/></field>
 </form>


And I'm getting the following error:



The Following Errors Occurred:

... (SQL Exception while setting value on field [imageData] of entity ImageDataResource: (An attempt was made to put a data value of type 'java.lang.String' into a data value of type 'BLOB'.))]

So it seems, that the name of the file but not the file-data itself is passed to the service. Can anyone help how to use the service correctly?

Thanks a lot!
Alexander
Reply | Threaded
Open this post in threaded view
|

Re: Problem eith Form-Field of type "file"

Mridul Pathak-2
Use <form type="upload">.  That would actually render an html from with
"enctype=multipart/form-data" required for file upload.

--
Thanks & Regards
Mridul Pathak
Hotwax Media
http://www.hotwaxmedia.com
[hidden email]
-------------------------------------------------
direct: +91 - 942.592.6892

On Sat, Jan 23, 2010 at 10:26 AM, Alexander1893 <
[hidden email]> wrote:

>
> Hi all,
>
> I want to add a new imageDataResource using the Service
> createImageDataResource.
>
> I'm using the following form:
>
>  <form type="single" name="singleFileUpload"
> target="performSingleFileUpload">
>                <field tooltip="I'm a tooltip" name="imageData"
> title="Select
> Image:"><file/></field>
>                <field name="submitButton" title="${uiLabelMap.CommonAdd}"
> widget-style="smallSubmit"><submit button-type="button"/></field>
>  </form>
>
> And I'm getting the following error:
>
>
>
> The Following Errors Occurred:
>
> ... (SQL Exception while setting value on field [imageData] of entity
> ImageDataResource: (An attempt was made to put a data value of type
> 'java.lang.String' into a data value of type 'BLOB'.))]
>
> So it seems, that the name of the file but not the file-data itself is
> passed to the service. Can anyone help how to use the service correctly?
>
> Thanks a lot!
> Alexander
>
> --
> View this message in context:
> http://n4.nabble.com/Problem-eith-Form-Field-of-type-file-tp1288314p1288314.html
> Sent from the OFBiz - User mailing list archive at Nabble.com.
>