<h1>Single File Upload</h1>
  <input type="file" id="file-uploader">
  <p>Upload a file and see the output in browser console</p>
  <p id="feedback"></p>
html {
  height: 100%;

body {
  background: white;
  color: black;

div {
  display: flex;
  justify-content: center;
  flex-direction: column;
  align-items: center;
  font-family: 'Roboto Mono', monospace;
const fileUploader = document.getElementById('file-uploader');

fileUploader.addEventListener('change', (event) => {
  const files = event.target.files;
  console.log('files', files);
  const feedback = document.getElementById('feedback');
  const msg = `File ${files[0].name} uploaded successfully!`;
  feedback.innerHTML = msg;

External CSS

This Pen doesn't use any external CSS resources.

External JavaScript

This Pen doesn't use any external JavaScript resources.