Hi Giri. I’m sorry for the long respond time. I don’t always get notifications on this forum. I appreciate your time very much!
Here’s the error:

However, the field itself is over 36.000 lines, so I can’t copy the contents in here.
But here’s the first few lines:
{
"body": {
"_readableState": {
"decoder": null,
"defaultEncoding": "utf8",
"ended": false,
"autoDestroy": false,
"pipes": null,
"endEmitted": false,
"awaitDrain": 0,
"reading": false,
"emittedReadable": false,
"buffer": {
"length": 13,
"tail": {
"next": null,
"data": {
"type": "Buffer",
"data": [
It’s the data attribute that’s huge.
The above is what I get in the httpresponse and what I try to save into the collection. Here’s the full code. I run it in the backend.
I get status code 200 which is successful.
export async function getPDFfromAWS(fetchUrl) {
fetch(fetchUrl, {
"headers": {
"Content-Type": "application/pdf"
},
"method": "get",
"mode": 'no-cors',
})
.then( (httpResponse) => {
let url = httpResponse.url;
let statusCode = httpResponse.status;
let statusText = httpResponse.statusText;
let headers = httpResponse.headers;
let bodyUsed = httpResponse.bodyUsed;
var body = httpResponse.body;
if (httpResponse.ok) {
console.log(statusCode + " " + statusText);
let toUpdate = {
"_id": "f5ea6533-ad44-40a1-a1f6-1f5cc5d94ac5",
"applicationPdf": httpResponse,
};
wixData.save("GrantApplications", toUpdate)
.then( (results) => {
let item = results; //see item below
console.log(item)
} )
.catch( (err) => {
let errorMsg = err;
console.log(err)
} );
console.log(httpResponse)
return httpResponse;
}
else {
return Promise.reject("Fetch did not succeed");
}
} )
.catch( (err) => {
console.log("error "+err);
} );
}