Pen Settings



CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URLs added here will be added as <link>s in order, and before the CSS in the editor. You can use the CSS from another Pen by using its URL and the proper URL extension.

+ add another resource


Babel includes JSX processing.

Add External Scripts/Pens

Any URL's added here will be added as <script>s in order, and run before the JavaScript in the editor. You can use the URL of any other Pen and it will include the JavaScript from that Pen.

+ add another resource


Add Packages

Search for and use JavaScript packages from npm here. By selecting a package, an import statement will be added to the top of the JavaScript editor for this package.


Auto Save

If active, Pens will autosave every 30 seconds after being saved once.

Auto-Updating Preview

If enabled, the preview panel updates automatically as you code. If disabled, use the "Run" button to update.

Format on Save

If enabled, your code will be formatted when you actively save your Pen. Note: your code becomes un-folded during formatting.

Editor Settings

Code Indentation

Want to change your Syntax Highlighting theme, Fonts and more?

Visit your global Editor Settings.



  <div class="container">
    <div class="row">
      <div class="col-xs-12">
        <div class="panel panel-default">
          <div class="panel-body">
            <span class="glyphicon glyphicon-cloud-upload"></span>
            <h2>File Uploader</h2>
            <div class="progress">
              <div class="progress-bar" role="progressbar"></div>
            <button class="btn btn-lg upload-btn" type="button">Upload File</button>

  <input id="upload-input" type="file" name="uploads[]" multiple="multiple"></br>

  <script src=""></script>
  <script src=""></script>


                .btn:focus, .upload-btn:focus{
  outline: 0 !important;

body {
  height: 100%;
  background-color: #4791D2;

body {
  text-align: center;
  font-family: 'Raleway', sans-serif;

.row {
  margin-top: 80px;

.upload-btn {
  color: #ffffff;
  background-color: #F89406;
  border: none;

.upload-btn:active, {
  color: #ffffff;
  background-color: #FA8900;
  border: none;

h4 {
  padding-bottom: 30px;
  color: #B8BDC1;

.glyphicon {
  font-size: 5em;
  color: #9CA3A9;

h2 {
  margin-top: 15px;
  color: #68757E;

.panel {
  padding-top: 20px;
  padding-bottom: 20px;

#upload-input {
  display: none;

@media (min-width: 768px) {
  .main-container {
    width: 100%;

@media (min-width: 992px) {
  .container {
    width: 450px;


                $('.upload-btn').on('click', function (){

$('#upload-input').on('change', function(){

  var files = $(this).get(0).files;

  if (files.length > 0){
    var formData = new FormData();
    for (var i = 0; i < files.length; i++) {
      var file = files[i];
      formData.append('uploads[]', file,;

      url: '',
      type: 'POST',
      data: formData,
      processData: false,
      contentType: false,
      success: function(data){
          console.log('upload successful!\n' + data);
      xhr: function() {
        // create an XMLHttpRequest
        var xhr = new XMLHttpRequest();

        // listen to the 'progress' event
        xhr.upload.addEventListener('progress', function(evt) {

          if (evt.lengthComputable) {
            // calculate the percentage of upload completed
            var percentComplete = evt.loaded /;
            percentComplete = parseInt(percentComplete * 100);

            // update the Bootstrap progress bar with the new percentage
            $('.progress-bar').text(percentComplete + '%');
            $('.progress-bar').width(percentComplete + '%');

            // once the upload reaches 100%, set the progress bar text to done
            if (percentComplete === 100) {


        }, false);

        return xhr;