get Base64 BiinaryFile with Storage Provider Setting from WebService

82 views
Skip to first unread message

Avian Driyanto

unread,
Nov 16, 2021, 11:44:58 PM11/16/21
to iDempiere
After create a Directory Image in Storage Provider, and change the Image Store in Client. Now all the uploaded image is store in directory. So the BinaryData in AD_Image only hold data like this
<?xml version="1.0" encoding="UTF-8"?><image><entry file="%IMAGE_FOLDER%AD_Image\1000000\1038076"/></image>. 

Opening the Image from iDempiere host is not a problem, the problem is when i'm trying to fetch it using WebService. 

it became base64, like this.
PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz48aW1hZ2U+PGVudHJ5IGZpbGU9IiVJTUFHRV9GT0xERVIlQURfSW1hZ2VcMTAwMDAwMFwxMDM4MDc2Ii8+PC9pbWFnZT4=

when i'm try to decode it, it just the BinaryData from above, 

how do accesing the File right now? any sugestion? 
 




Carlos Antonio Ruiz Gomez

unread,
Nov 17, 2021, 5:44:11 AM11/17/21
to idem...@googlegroups.com
Hi Avian, sounds like a bug, is that SOAP or REST?

Regards,

Carlos Ruiz


El 17/11/21 a las 5:44, Avian Driyanto escribió:

Avian Driyanto

unread,
Nov 17, 2021, 7:26:37 AM11/17/21
to iDempiere
i use SOAP, my iDempiere is still version 7.1. 

Avian Driyanto

unread,
Nov 17, 2021, 7:29:24 AM11/17/21
to iDempiere
for testing the SOAP, i use the SOAPUI. 

Carlos Antonio Ruiz Gomez

unread,
Nov 17, 2021, 7:33:46 AM11/17/21
to idem...@googlegroups.com
Yes, that's probably a bug, please open a JIRA ticket describing the case.

If you know the solution, a pull request is 100% welcome too.

Regards,

Carlos Ruiz


El 17/11/21 a las 13:29, Avian Driyanto escribió:

Avian Driyanto

unread,
Nov 17, 2021, 7:42:30 AM11/17/21
to iDempiere
I Think the problem is in the File ModelADServiceImpl.java. The serviceType i use is QueryData, 
if(rsquery.getObject(columnName) instanceof byte[])
dfid.setVal(new String(Base64.encodeBase64(rsquery.getBytes(columnName))));  <-- This is the problem Part, only change the field value into Base64. 
else
dfid.setVal(rsquery.getString(columnName));

btw i got it work, by adding MImage Directly for testing and it works. I Never open a Jira ticket in here. 

ModelADServiceImpl.png

Avian Driyanto

unread,
Nov 17, 2021, 8:00:16 AM11/17/21
to iDempiere
https://idempiere.atlassian.net/browse/IDEMPIERE-5044, i already open a ticket in jira. Sorry for the bad english. 
Reply all
Reply to author
Forward
0 new messages