function fileIntoMemory (file, index, callback) {
            // eslint-disable-next-line no-undef
            var reader = new FileReader();
            var asText = !!attr.readAsText;
            reader.onload = function () {
               var content = asText ? this.result : new Uint8Array(this.result);
               callback({
                  filename: file.name,
                  size: file.size,
                  mimetype: file.type,
                  content: content
               }, index);
            };
            if (asText) {
               reader.readAsText(file);
            } else {
               reader.readAsArrayBuffer(file);
            }

         }
/**
          * Utility function that can be used as handler wrapper
          * for initializeDragAndDrop.
          * This reads the entire file into memory
          *
          * The handler function gets passed an array of objects:
          * {
          *     name: filename as string,
          *     size: size in bytes as number,
          *     type: MIME type as string,
          *     content: file content as Uint8Array
          * }
          * @param file The file to read
          * @param handler
          */
Utility function that can be used as handler wrapper
for initializeDragAndDrop.
This reads the entire file into memory


Utility function that can be used as handler wrapper for initializeDragAndDrop . This reads the entire file into memory
function fileIntoMemory (file, index, callback) {
            var reader = new FileReader();
            var asText = !!attr.readAsText;
            reader.onload = function () {
               var content = asText ? this.result : new Uint8Array(this.result);
               callback({
                  filename: file.name,
                  size: file.size,
                  mimetype: file.type,
                  content: content
               }, index);
            };
            if (asText) {
               reader.readAsText(file);
            } else {
               reader.readAsArrayBuffer(file);
            }
         }
function fileIntoMemory ( file , index , callback ) { var reader = new FileReader ( ) ; var asText = ! ! attr . readAsText ; reader . onload = function ( ) { var content = asText ? this . result : new Uint8Array ( this . result ) ; callback ( { filename : file . name , size : file . size , mimetype : file . type , content : content } , index ) ; } ; if ( asText ) { reader . readAsText ( file ) ; } else { reader . readAsArrayBuffer ( file ) ; } }
Utility function that can be used as handler wrapper
 for initializeDragAndDrop.
Utility function that can be used as handler wrapper for initializeDragAndDrop .
// eslint-disable-next-line no-undef