Pen Settings

HTML

CSS

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URL's added here will be added as <link>s in order, and before the CSS in the editor. If you link to another Pen, it will include the CSS from that Pen. If the preprocessor matches, it will attempt to combine them before processing.

+ add another resource

JavaScript

Babel is required to process package imports. If you need a different preprocessor remove all packages first.

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

Behavior

Save Automatically?

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.

HTML

              
                <div class="drop">Drag'n'Drop File Here</div>
<div class="list"></div>
<div class="status"></div>

<input type="file" name="cycleDocument" id="cycleDocument" class="" tabindex="" />


<!--

URL's of snips'n'scripts'n'helps etc...

gonna try this next @ https://github.com/blueimp/jQuery-File-Upload


STACKOVERFLOWS...

the one i'm deleted on @
http://stackoverflow.com/questions/8006715/drag-drop-files-into-standard-html-file-input/26538554#26538554
...will ask about this one being edited too...
http://stackoverflow.com/questions/25204528/how-to-upload-a-file-dropped-on-the-screen

full page drag and drop files website
http://stackoverflow.com/questions/19841859/full-page-drag-and-drop-files-website

why is file drag and drop disabling draggable elements?
http://stackoverflow.com/questions/20226305/why-is-file-drag-and-drop-disabling-draggable-elements

Passing path to uploaded file from HTML5 drag & drop to input field
http://stackoverflow.com/questions/10500362/passing-path-to-uploaded-file-from-html5-drag-drop-to-input-field?rq=1


HTMLGOODIES...

article jsfiddle comment is from @
http://www.htmlgoodies.com/html5/javascript/drag-files-into-the-browser-from-the-desktop-HTML5.html 

Using HTML5 and the Blueimp jQuery-File-Upload Plugin To Upload Large Files
http://www.htmlgoodies.com/html5/other/using-html5-and-the-blueimp-jquery-file-upload-plugin-to-upload-large-files.html 

Responding to HTML5 FileReader Events
http://www.htmlgoodies.com/html5/other/responding-to-html5-filereader-events.html 

Working With the Drag and Drop API in HTML5
http://www.htmlgoodies.com/html5/other/working-with-the-drag-and-drop-api-in-html5.html 

HTML 5 Drag & Drop Basics
http://www.htmlgoodies.com/html5/tutorials/html-5-drag-drop-basics.html 

Move Data and DOM Elements using Drag & Drop
http://www.htmlgoodies.com/html5/javascript/move-data-and-dom-elements-using-drag-drop.html 


GOOGLE SEARCHES...

g-search: how to add simple drag & drop into current file upload form field @
https://www.google.com/search?client=safari&rls=en&q=jquery+file+upload+drop&ie=UTF-8&oe=UTF-8#q=how+to+add+simple+drag+%26+drop+into+current+file+upload+form+field&newwindow=1&rls=en&start=20

g-search: restrict file drag and drop to single file @
https://www.google.com/search?client=safari&rls=en&q==+fileNumber+%3C+files.length+%3F.innerHTML+=+fileNumber+%3C+files.length++++++++++++++++++++++%3F+'&ie=UTF-8&oe=UTF-8#newwindow=1&rls=en&q=restrict+file+drag+and+drop+to+single+file


-->
              
            
!

CSS

              
                .drop {
    min-height: 50px;
    width: 250px;
    border: 1px solid blue;
    margin: 10px;
    padding: 10px;
}
              
            
!

JS

              
                // http://www.htmlgoodies.com/html5/javascript/drag-files-into-the-browser-from-the-desktop-HTML5.html
// code by Commenter JacobEdmondKerr said on February 26, 2013 at 10:05 pm - demo @ http://jsfiddle.net/JtJ5N/1/     

if(window.FileReader) { 
  //var drop; 
  addEventHandler(window, 'load', function() {
    var status = document.getElementsByClassName('status')[0];
    var drop   = document.getElementsByClassName('drop')[0];
    var list   = document.getElementsByClassName('list')[0];

    function cancel(e) {
      if (e.preventDefault) { 
        e.preventDefault(); 
      }
      return false;
    }

    // Tells the browser that we *can* drop on this target
    addEventHandler(drop, 'dragover', cancel);
    addEventHandler(drop, 'dragenter', cancel);
    addEventHandler(drop, 'drop', function (e) {
      e = e || window.event; // get window.event if e argument missing (in IE)   

      if (e.preventDefault) { 
        e.preventDefault(); 
      } // stops the browser from redirecting off to the image.

      var dt = e.dataTransfer;
      var files = dt.files;
      for (var i=0; i<files.length; i++) {
        var file = files[i];
        var reader = new FileReader();

        //attach event handlers here...
        reader.readAsDataURL(file);
        addEventHandler(reader, 'loadend', function(e, file) {
          var bin = this.result; 

          //	div.list...
          var newFile       = document.createElement('span');
          newFile.innerHTML = 'Selected File: '+file.name+' (size: '+file.size+' bytes)';
          list.appendChild(newFile);  
          //  var fileNumber = list.getElementsByTagName('div').length;

          //	div.status...
          status.innerHTML = 'This file is ready to be uploaded upon submission.';

          //status.innerHTML = fileNumber < files.length 
          //? 'Loaded 100% of file '+fileNumber+' of '+files.length+'...' 
          //: 'Done loading. processed '+fileNumber+' files.';

          // var img = document.createElement("img"); 
          // img.file = file;   
          // img.src = bin;
          // list.appendChild(img);

        }.bindToEventHandler(file));
      }
      return false;
    });

    Function.prototype.bindToEventHandler = function bindToEventHandler() {
      var handler = this;
      var boundParameters = Array.prototype.slice.call(arguments);
      //create closure
      return function(e) {
        e = e || window.event; // get window.event if e argument missing (in IE)   
        boundParameters.unshift(e);
        handler.apply(this, boundParameters);
      };
    };
  });
} else { 
  document.getElementsByClassName('status')[0].innerHTML = 'Your browser does not support the HTML5 FileReader.';
}
function addEventHandler(obj, evt, handler) {
  if(obj.addEventListener) {
    // W3C method
    obj.addEventListener(evt, handler, false);
  } else if(obj.attachEvent) {
    // IE method.
    obj.attachEvent('on'+evt, handler);
  } else {
    // Old school method.
    obj['on'+evt] = handler;
  }
}
              
            
!
999px

Console