diff --git a/lib/codemirror.js b/lib/codemirror.js
index 3605006c7fbe97695a57b0c7da491fc4713b03ae..996978fc67b97c6d0f2044fba2a5ba567261150a 100644
--- a/lib/codemirror.js
+++ b/lib/codemirror.js
@@ -3821,6 +3821,9 @@
     if (files && files.length && window.FileReader && window.File) {
       var n = files.length, text = Array(n), read = 0;
       var loadFile = function(file, i) {
+        if(this.options.allowDroppedFileTypes !== undefined && this.options.allowDroppedFileTypes.indexOf(file.type) === -1)
+          return;
+
         var reader = new FileReader;
         reader.onload = operation(cm, function() {
           text[i] = reader.result;