Storing a PDF file in Wix Collection

Hi, I’m trying to save a pdf file (which I receive as a HtmlResponse from a fetch call) in a data field in a Wix Collection.
The data field is already in a document format.
My issue is with handling a HtmlResponse which includes the PDF file.

This is how my fetch call looks right now:
fetch(url, {
method: method,
headers: headers,
body: data
})
.then( (httpResponse) => {
if (httpResponse.ok) {
console.log(“RESPONSE OK”);
return httpResponse.json();
} else {
return Promise.reject(“Fetch did not succeed”);
}
} )
.then( json => {
return json;
})
. catch (err => console.log("Error: " + err));
};

Now, instead of handling JSON (as the response) I need to handle a PDF file.

Please help, Thank you very much!

The wix fetch() API does not currently support a PDF file in a fetch request response. This is being considered and might be available in the future.

Hi Yisreal, I’m trying to do the same thing, has the suport for PDF been added?