jquery accept only excel file
<input type="file" ID="fileSelect" accept=".xlsx, .xls, .csv"/>
jquery accept only excel file
<input type="file" ID="fileSelect" accept=".xlsx, .xls, .csv"/>
input type file csv only
<input type="file" id="img" name="img" accept=".csv, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet, application/vnd.ms-excel">
read excel file using javascript html
// the simplest way to read excel is to use sheetjs
// https://github.com/SheetJS/sheetjs
// A. in nodejs
var XLSX = require('xlsx');
var workbook = XLSX.readFile('test.xlsx');
/* DO SOMETHING WITH workbook HERE */
// B. in browser
// 1. first include the library
// <script src="dist/xlsx.full.min.js"></script>
// 2. handle the file upload in a script
function handleFile(e) {
var files = e.target.files, f = files[0];
var reader = new FileReader();
reader.onload = function(e) {
var data = new Uint8Array(e.target.result);
var workbook = XLSX.read(data, {type: 'array'});
/* DO SOMETHING WITH workbook HERE */
};
reader.readAsArrayBuffer(f);
}
input_dom_element.addEventListener('change', handleFile, false);
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us