function tick() {

        /**
         * @var {object} file The current state of the input file field
         */
        var file = input.files && input.files[0];

        /**
         * @var {integer} previousFileSize The previous filesize stored in sessionStorage
         */
        var previousFileSize = sessionStorage.getItem(file.name + 'filesize');

        /**
         * @var {integer} currentFileSize The current filesize
         */
        var currentFileSize = input.files && input.files[0].size;

        /**
         * sessionStorage handle, store a key|value pair
         * @param {string} name            The keyname
         * @param {string} currentFileSize The current filesize
         * @note Added file.name to have an unique key and be able to track multi files in multiple tabs
         */
        sessionStorage.setItem(file.name + 'filesize',currentFileSize);

        /**
         * Check if filesize changed since previous check
         */
        if(previousFileSize != currentFileSize) {

            /**
             * Get the Filereader
             * @var {object} reader
             */
            var reader = new FileReader();

            /**
             * EventListener, will trigger everytime the reader.readAsText() function is used
             * @param {string} event Required to be set to 'load'
             */
            reader.addEventListener('load', function() {

                /**
                 * Print file content to browser ~ for development only
                 * document.getElementById('file').innerText = this.result;
                 */

                /**
                 * @var {string} text The file content
                 */
                var text = this.result;

                /**
                 * HTML element ID to add response to ~ for development only
                 * @var {string} resp
                 */
                var resp = $("#response");

                /**
                 * Pass variables for processing
                 * @param {string}        type post|get Default 'POST'
                 * @param {string|global} url  URL receiving script relative|absolute ~ local|hosted
                 * @param {array|json}    data The data to send to the script
                 */
                $.ajax({
                    type: "POST",
                    url: "system/processor.php",
                    data: {
                        filename : file.name,
                    },

                    // Before call ajax you can do activity like please wait message
                    beforeSend: function(xhr){
                        resp.html("Please wait...");
                    },

                    // Will call if method not exists or any error inside php file
                    error: function(qXHR, textStatus, errorThrow){
                        resp.html("There are an error");
                    },

                    success: function(data, textStatus, jqXHR){
                        resp.html(data);
                    }

                });

            });
            reader.readAsText(document.querySelector('input').files[0]);
        }

    }
/**
     * Function to get current file input state and read local file
     * @return {bool} True|False
     */
Function to get current file input state and read local file
@return {bool} True|False
Function to get current file input state and read local file @return { bool } True|False
function tick() {
        var file = input.files && input.files[0];
        var previousFileSize = sessionStorage.getItem(file.name + 'filesize');
        var currentFileSize = input.files && input.files[0].size;
        sessionStorage.setItem(file.name + 'filesize',currentFileSize);
        if(previousFileSize != currentFileSize) {
            var reader = new FileReader();
            reader.addEventListener('load', function() {
                var text = this.result;
                var resp = $("#response");
                $.ajax({
                    type: "POST",
                    url: "system/processor.php",
                    data: {
                        filename : file.name,
                    },
                    beforeSend: function(xhr){
                        resp.html("Please wait...");
                    },
                    error: function(qXHR, textStatus, errorThrow){
                        resp.html("There are an error");
                    },
                    success: function(data, textStatus, jqXHR){
                        resp.html(data);
                    }
                });
            });
            reader.readAsText(document.querySelector('input').files[0]);
        }
    }
function tick ( ) { var file = input . files && input . files [ 0 ] ; var previousFileSize = sessionStorage . getItem ( file . name + 'filesize' ) ; var currentFileSize = input . files && input . files [ 0 ] . size ; sessionStorage . setItem ( file . name + 'filesize' , currentFileSize ) ; if ( previousFileSize != currentFileSize ) { var reader = new FileReader ( ) ; reader . addEventListener ( 'load' , function ( ) { var text = this . result ; var resp = $ ( "#response" ) ; $ . ajax ( { type : "POST" , url : "system/processor.php" , data : { filename : file . name , } , beforeSend : function ( xhr ) { resp . html ( "Please wait..." ) ; } , error : function ( qXHR , textStatus , errorThrow ) { resp . html ( "There are an error" ) ; } , success : function ( data , textStatus , jqXHR ) { resp . html ( data ) ; } } ) ; } ) ; reader . readAsText ( document . querySelector ( 'input' ) . files [ 0 ] ) ; } }
Function to get current file input state and read local file
 @return {bool} True|False
Function to get current file input state and read local file @return { bool } True|False
/**
         * @var {object} file The current state of the input file field
         */ /**
         * @var {integer} previousFileSize The previous filesize stored in sessionStorage
         */ /**
         * @var {integer} currentFileSize The current filesize
         */ /**
         * sessionStorage handle, store a key|value pair
         * @param {string} name            The keyname
         * @param {string} currentFileSize The current filesize
         * @note Added file.name to have an unique key and be able to track multi files in multiple tabs
         */ /**
         * Check if filesize changed since previous check
         */ /**
             * Get the Filereader
             * @var {object} reader
             */ /**
             * EventListener, will trigger everytime the reader.readAsText() function is used
             * @param {string} event Required to be set to 'load'
             */ /**
                 * Print file content to browser ~ for development only
                 * document.getElementById('file').innerText = this.result;
                 */ /**
                 * @var {string} text The file content
                 */ /**
                 * HTML element ID to add response to ~ for development only
                 * @var {string} resp
                 */ /**
                 * Pass variables for processing
                 * @param {string}        type post|get Default 'POST'
                 * @param {string|global} url  URL receiving script relative|absolute ~ local|hosted
                 * @param {array|json}    data The data to send to the script
                 */ // Before call ajax you can do activity like please wait message // Will call if method not exists or any error inside php file