on 2024 Jan 28 8:05 AM
I am trying to upload PDF in SAP BTP DMS using CAP Project and i am getting error. No Content Available when displaying the PDF. It is getting uploaded successfully.
I have base 64 for PDF and I am converting it using Buffer var buf = Buffer.from(base64, "base64");
Below is my Code
Request clarification before answering.
Hi,
I recently wrote some similar code to upload a file to a cmis system (not BTP DMS). I'm adding the buffer content like this:
form.append('content', file.content, {
contentType: file.mediaType,
filename: file.fileName
})
You are sure that 'datafile' is correct?
formData.append("datafile", buf);
I also add the Content-Length to the header like this:
const headers = {
...form.getHeaders(),
'Content-Length': form.getLengthSync()
}
BR,
Nico
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
63 | |
8 | |
7 | |
7 | |
5 | |
5 | |
5 | |
4 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.