[OGo-XML-RPC] JOGI - Document Upload
Derya K.
xmlrpc@opengroupware.org
Sat, 06 May 2006 10:13:28 +0200
Adam Tauno Williams schrieb:
>>i have a question regarding the JOGI API!
>>I want to upload files...
>>I know there is a method to create a new Document in Project with
>>public boolean *newDocument*(java.lang.String path,
>> java.lang.String content,
>> Attribute attr)
>>but how can i upload a Document which exists in a filesystem?
>>For example a jpg Picture??
>>
>>
>
>Have you tried reading the file into a string and using that as the
>parameter? You may need to base64 encode the string.
>
>
File datei = new File("picture.jpg");
byte[] fby = getBytesFromFile(datei);
String content = new BASE64Encoder().encode(fby);
project.newDocument("pic.jpg", content, null);
I tried it thatway... but it doesn't work!!!
The File is there but i can't see the picture in OGo!
Maybe somebody know? What i'm doing wrong?
Thanks
Bye Derya