You need to sign in to do that
Don't have an account?

Rest API PDF Document is stored as base64 and not getting opened
Hello All,
I am using 3rd party document drive. I am sending files from salesforce via rest api. All the files are stored as base64 and not getting opened when it is downloaded. What i am sending is as follows,
But the document is not getting opened. It is always showing error, when i tried to open the document in sublime, it shows the base64 code. Please help me.
when i tried this data in postman it is working correctly, please tell me what content type are used in post man, the generate code not generating content type for files that i have uploaded.

Thanks.
I am using 3rd party document drive. I am sending files from salesforce via rest api. All the files are stored as base64 and not getting opened when it is downloaded. What i am sending is as follows,
header: 'Content-Type','multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW' Body: ------WebKitFormBoundary7MA4YWxkTrZu0gW Content-Disposition: form-data; name="metadata" {"indexingValues":[{"fieldName":"Doctype","values":["Test"]},{"fieldName":"DocOrigin","values":["SFDC"]}]} ------WebKitFormBoundary7MA4YWxkTrZu0gW Content-Disposition: form-data; name="files"; filename="helloworld6.pdf" Content-Type:application/pdf JVBERi0xLjUNCiW1tbW1DQ**removed base64** ------WebKitFormBoundary7MA4YWxkTrZu0gW-- The document is sent to document drive USER_DEBUG [37]|DEBUG|System.HttpResponse[Status=OK, StatusCode=200]
But the document is not getting opened. It is always showing error, when i tried to open the document in sublime, it shows the base64 code. Please help me.
when i tried this data in postman it is working correctly, please tell me what content type are used in post man, the generate code not generating content type for files that i have uploaded.
Thanks.
Try with below-changed code: Hope this helps.
Mark this as solved if it's resolved.
Best Regards,
Nagendra.P