on 04-13-2016 6:52 PM
Hello,
I have a Gateway service setup to receive a photo (as Base64), the service field is typed as Edm.String, the subsequent FM that gets called has an field typed as String as well.
I am pretty sure the Base64 is coming across ok (took the base64 from the request and stuck it in a online converter), what I am trying to do is create a Document based on this jpg.
After some research it seems I am supposed to use:
SSFC_BASE64_DECODE
then
SCMS_XSTRING_TO_BINARY
I am attempting to create this jpg on the server then create the Document from that using
CV120_DOC_GET_APPL
I think the issue is coming after SCMS_XSTRING_TO_BINARY when I am transferring the itab to the dataset.
My code runs successfully, the Document is created and the jpg shows up as part of the Document (confirmed in CV03N), but when I try and open the jpg, I just get the message 'Failed to open document"
Looking for any thoughts or ideas.
-Mike
Figured it out ....
There was some mime type info at the beginning of the Base64 that I had to peel out
Ex:
data:image/jpeg;base64,/9j/4AAQSkZJRgABAQEASABI...
I had to remove the text in bold, after that it worked fine.
Another note, I did not need to make the call to SCMS_XSTRING_TO_BINARY, I was able to output the result from SSFC_BASE64_DECODE to the dataset.
-Mike
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
87 | |
10 | |
10 | |
9 | |
7 | |
6 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.