Guys, I managed to solve the problem, I needed to create a file type input, and make a script code with Filereader, so it reads the file and presents
<input type='file' accept='file/*' onchange='openFile(event)'>
<div id="framePDF" class="framePDF" style="display: none">
<br>
<iframe id="frame" style="WIDTH: 100%; HEIGHT: 650px" frameBorder=0;></iframe>
<!--O Comando iFrame permite criar um frame na página web para a leitura de um arquivo PDF -->
</div>
<script>
var openFile = function(event) {
var input = event.target;
document.getElementById('framePDF').style.display = 'block';
var reader = new FileReader();
reader.onload = function() {
var dataURL = reader.result;
var output = document.getElementById('frame');
output.src = dataURL;
};
reader.readAsDataURL(input.files[0]);
};
</script>
I appreciate your help... With this code, it creates an iframe, the user chooses a file from the machine itself, the script processes it, reads it, and places the information inside the iframe
You want to display the client’s local file?
– Woss
Yes, that’s exactly it...
– Lucas Almeida
is not possible, will appear as fakepath
– Leandro Angelo
Actually your question does not make much sense... you want to display in the browser a file that is on the client’s machine instead of uploading?
– Leandro Angelo