on ‎2014 Jan 16 6:41 PM
Hi all cloud developers,
currently I'm facing issue to which I can't find solution. I get through web service call binary content as base64 string. I want to store it as attachment in cloud. But currently seems like there is no possibility to do that.
First I thought that Binary.ParseFromString() function could solve this issue but now I understood that it's used differently.
Does anybody of you faced this issue and found solution?
Thanks,
Uldis
Request clarification before answering.
Hi Horst,
this approach I've tried and thats why I had this question because with following approach we will get following error "Assignment of the type 'String' to the type 'Binary' is not possible."
There is missing some kind of base64 decode function, because Binary library allows us only encode binary to base64 string.
BR,
Uldis
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Horst,
Following error will appear in ABSL editor.
When I use Binary.ParseFromString() I'll get errors when I try to open those attachment files, that content is corupped. I assume ParseFromString is used only to covert text content, i.e, html content.
Example for my binary object content:
cpBinary.content = Binary.ParseFromString(impBase64);
cpBinary.fileName = "recievedfile.pdf";
cpBinary.characterSetCode = "utf-8";
cpBinary.mimeCode = "application/pdf";
Hi Horst,
if you are using ParseFromString you won't get an error.
cpBinary is BinaryObject.
This will go through. But when I add this binary object to DO Attachment and try to open the file I'll get error that file is corrupted or it's not PDF. This error you will get when you are opening downloade file on your computer.
Hello Uldis,
When do you access the file:
Reason:
I've talked to the Attachment colleagues and depending on that they access their original buffer, modified buffer or must read from DB. They told me that may be the reason.
Please test.
Bye,
Horst
Hi Horst,
I tested all three scenarios and result was same. I'm not sure that this would be a reason.
Binary is saved in attachement folder with structure what I assigned to BinaryObject when I parsed base64 string to binary. After that using creatFile action I added it to Attachment Folder.
BR,
Uldis
Hi,
you are right. I thought that the input was a string.
You can try all the codification types listed in the table:
Base64 - Wikipedia, the free encyclopedia
Or you can ask SAP people what kind of codification they use
| User | Count |
|---|---|
| 13 | |
| 8 | |
| 7 | |
| 5 | |
| 4 | |
| 3 | |
| 2 | |
| 2 | |
| 2 | |
| 2 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.