Hi Fai Kwong,

    If you want to upload a file, No need to write code for uploading its
already present there in OFBiz framework.
    You can also see functionality of uploading in party component. Create a
new party(person/customer) you   can see section 'Party Content' for browse
and uploading file. Just you have to select purpose & mime/type.
    If you want to update click on link of party content created (say
10010). It takes you to the Parties/PARTY CONTENT tab there you can Edit &
upload another file.

    Code flow can be started from 'createPartyContent' request in party
controller. There is a simple method
    'createPartyContent' in
component://party/script/org/ofbiz/party/party/PartySimpleEvents.xml
file which  internally calls uploadImageAndParameters() method of class
'org.ofbiz.content.layout.LayoutWorker' which converts file into byte
arrray, then it calls service 'createPartyContent' which upload byte array
of the file to the Database.

    You just need to go through the code. That can help you.

---
 Thanks & Regards,
Pankaj Savita
Mob: 09890262476
Email: 
pankajsav...@gmail.com<http://redir.aspx/?C=172aa0592ccc4a40a7119b8b86b626f8&URL=mailto%3apankajsavita%40gmail.com>


On Fri, Sep 24, 2010 at 11:31 AM, Jacques Le Roux <
jacques.le.r...@les7arts.com> wrote:

> Fai Kwong,
>
> Beware you were sending your email to
> user-subscr...@ofbiz.apache.org
> user-unsubscr...@ofbiz.apache.org
> dev-subscr...@ofbiz.apache.org
> dev-unsubscr...@ofbiz.apache.org
> user@ofbiz.apache.org
> d...@ofbiz.apache.org
> y.kw...@hotmail.com
>
> I guess you wanted only user@ofbiz.apache.org
> Please check
> https://cwiki.apache.org/confluence/display/OFBADMIN/Mailing+Lists
>
> Jacques
>
> From: "BJ Freeman" <bjf...@free-man.net>
>
>  if I understand you are asking about fileupload
>> take a look at the code for uploading an image in the
>> catatlog->product->content
>>
>>
>> =========================
>> BJ Freeman
>> Strategic Power Office with Supplier Automation  <
>> http://www.businessesnetwork.com/automation/viewforum.php?f=52>
>> Specialtymarket.com  <http://www.specialtymarket.com/>
>> Systems Integrator-- Glad to Assist
>>
>> Chat  Y! messenger: bjfr33man
>> Fai Kwong sent the following on 9/23/2010 9:14 PM:
>>
>>
>>
>>> Dear ofbiz,
>>>
>>> I would like to attach a file and check that by a java event. I have done
>>> that by the example module.
>>>
>>> https://weberp.dyndns-server.com:8443/example/control/main
>>>
>>> I have created the servlet page for the web and done some code in
>>> controller that call the java event, but my problem is that how the java
>>> file can read that attachment file?
>>>
>>> Here I also attached some of my code.
>>>
>>>
>>
>
>

Reply via email to