Hi ,
I am uploading a .msg file by converting it into Byte steam .
String_bytes = System.io.File.ReadAllBytes(“C:.… file path…\Filename.msg”)
Then
Byte_stream = Convert.ToBase64String(String_bytes)
Then uploading the steam using Salesforce service API (services/apexrest/ServiceAPI2_Attach) , which is apparently different from standard SFDC API.
After the file is uploaded to SFDC and download it try to read the file ,i am unable to open the file and seems to be corrupted . I even tried with a .jpg and faced the same issue . i tried with multiple content types and still the issue could not be fixed .
binary
application/vnd.ms-outlook
application/octet-stream
multipart/form-data - which was not supported
application/json
and the uploaded file size is at least 15-20% larger than the original .
Please let me know if anyone has faced this issue or have any insights .