I'm currently trying to build a standalone file processing Windows application using Python Eel. The locations for both the source and destination files are defined by the user.
I'm using an iframe to display the source file and a textarea to display the process file which is editable within the UI. I have a function to set the src for the iframe and to write the value of the processed file into the textarea.
The issue is that only files in localhost/ are accessible from the application. CORS policy blocks file access. Is there a work around for this so that I can access files from the directory provided by the user?
Any help is appreciated, Thank you.
function setoutput() {
document.getElementById("source_iframe").src = "Test.pdf";
var xmlhttp, text;
xmlhttp = new XMLHttpRequest();
xmlhttp.open('GET', 'http://localhost:8000/Test.txt', false);
xmlhttp.send();
text = xmlhttp.responseText;
document.getElementById("dest_frame").innerHTML = text;
}
<div class="row editor-window">
<div class="col-sm" id="source_file_view">
<iframe src="about:blank" id="source_iframe"></iframe>
</div>
<div class="col-sm" id="feature_file_view">
<textarea id="dest_frame"></textarea>
</div>
</div>