<h2>Web-worker.in</h2>
<h3>Custom file browser</h3>
<input type="file" onchange="fileSelected()"
       id="hiddenFileBrowser" class="displayNone">
<input id="shownInput" placeHolder="No file selected..." class="inputbox"/>
<button onclick="triggerFileBrowser()" class="selectbtn">Select a File</button>
body{
  background:#FFD454;
  font-family:verdana;
  color:white;
}
.displayNone{
  display:none;
}
.selectbtn{
  height:35px;
  background-color:#a8d091;
  border:0px solid #abcdef;
  border-radius:5px;
  box-shadow:2px 2px 1px #0f0f0f;
  cursor:pointer;
  color:white;
  font-size:16px;
}
.inputbox{
  height:35px;
  width:250px;
  padding:0px 10px;
  border:none;
  box-shadow: inset 3px 5px 5px 0px #ABABAB;
-webkit-box-shadow: inset 3px 5px 5px 0px #ABABAB;
-moz-box-shadow: inset 3px 5px 5px 0px #ABABAB;
-o-box-shadow: inset 3px 5px 5px 0px #ABABAB;
}
function triggerFileBrowser(){
  $('#hiddenFileBrowser').trigger('click');
}
function fileSelected(fileobj){
  var fileName = $('#hiddenFileBrowser').val();
  $('#shownInput').val(fileName);
}
Run Pen

External CSS

This Pen doesn't use any external CSS resources.

External JavaScript

  1. https://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js