diff --git a/js/LoadSaveFile.js b/js/LoadSaveFile.js index c0d2aca..f2cd8ea 100644 --- a/js/LoadSaveFile.js +++ b/js/LoadSaveFile.js @@ -36,12 +36,20 @@ let bench = { * @param {FileList} input FileList object containing a list of File objects. The FileList behaves like an array, so you can check its length property to get the number of selected files. */ function LoadSaveFile(input, startTime = new Date()) { + + // console.info("Input length: " + input.files.length) + // Cease further processing if user canceled the file input dialog + if (input.files.length < 1) return false; + // start benchmark bench.begin.LSF = startTime; // Prepares a File object from the first file of the input files for reading as an Array Buffer let inputFileObject = input.files[0]; + // Cleans the file list to avoid problems after subsequent use + // document.getElementById("save-area-file").value = ""; + // 1. read file // The ArrayBuffer object is used to represent a generic, fixed-length raw binary data buffer. // It is an array of bytes, often referred to in other languages as a "byte array".