Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Transferring file to byte array

alancecchini
Participant
0 Likes
419

Hi,

We have a requirement to upload a document (any common file format, e.g. Word, Excel, PDF etc) into SAP then forward to a document management system which expects the document content to be submitted via a web service as a byte array in format base64Binary.

Can we simply use class CL_GUI_FRONTEND_SERVICES->GUI_UPLOAD specifying the file format as 'BIN' or do we need to do anything first to process the file content?

Thanks,

Alan

1 REPLY 1
Read only

mvoros
Active Contributor
0 Likes
334

Hi,

you need to preform additional step. base64 is special type of coding data (check wikipedia for more info about base64). base64 is used in HTTP protocol. Hence you can find methods for base64 encoding/decoding in class CL_HTTP_UTILITY. Those methods work with strings.

Cheers