We're trying to save a generated PDF back to Salesforce via an extension.
It works fine from within Salesforce where the interview is in an iframe. This request goes through as same-origin.
However, we also have an interview embedded in a div in a portal for which the same GET call on the form link either returns
500 Internal Server Error (without adding "?__embed=web") or
200 OK (with "?__embed=web") but with no content.
This request goes through as cross-site. I'm sending credentials, so the JSESSIONID cookie goes through, but the server still refuses to send me the PDF content for cross-site requests.
I've tried xhr, ajax, fetch, and even tried routing it through an intervew.fetch request where the connection was just pointed at the hub.
The form control object only exposes file name, mime type, and the click action. Unlike an upload control, I can't get to the file data itself.
Is there a way to access the "interview-session" value programmatically so that I can send this as a POST? That seems to work when I manually generate the request, but I don't know how to get that session ID other than copy/paste.
Any guidance or workaround would be much appreciated,
Cy