He creado una aplicación en ORACLE APEX
Donde tengo el explorador de archivos, el cuadro de texto y el envío. cuando selecciono el archivo, su primera línea debe leerse y mostrarse en el cuadro de texto al hacer clic en el botón Enviar
<!DOCTYPE html> <html> <body> <p>Choose file:</p> <input type="file" id="myFile" name="filename"> <input type="submit"> <br><br> <label for="fname">First line from csv file :</label> <input type="text" id="fname" name="fname"> </body> </html>mi codigo js
function confirmFileSubmit(){ var input = document.getElementById('fileUpload'); // get the input var file = input.files[0]; // assuming single file, no multiple var reader = new FileReader(); reader.onload = function(e) { var text = reader.result; // the entire file var firstLine = text.split('\n').shift(); // first line console.log(firstLine); // use the console for debugging } reader.readAsText(file, 'UTF-8'); // or whatever encoding you're using // UTF-8 is default, so this argument }