<script>
  $(document).ready(function() {
      const fileInput = document.querySelector('{{ target }} input[type=file]');
      fileInput.onchange = () => {
          if (fileInput.files.length > 0) {
              const fileName = document.querySelector('{{ target }} .file-name');
              fileName.textContent = Array.from(fileInput.files).map(x => x.name);
          }
      }
  });
</script>
