I'm using PDF.js in my Blazor server application, and it works fine with local files, but now I want to find a way to get pdf files on a network storge to expose them via some endpoint (controller) so that can do a GET request for them. I found some sample code, but most of them are using some content instead of a file path on a storage, like this:
"SaveAsFile" sample code using blazor
function saveAsFile(filename, bytesBase64) {
var link = document.createElement('a');
link.download = filename;
link.href = "data:application/octet-stream;base64," + bytesBase64;
document.body.appendChild(link); // Needed for Firefox
link.click();
document.body.removeChild(link);
}
can anyone help me for changing the usage of a file path instead of bytesbase64 in "saveAsFile" in above example code.