mirror of
https://github.com/raviriley/STL-to-OpenSCAD-Converter.git
synced 2024-11-22 14:43:10 +01:00
Added file extension verification
This commit is contained in:
parent
46508072ec
commit
f37c921031
13
main.js
13
main.js
@ -202,12 +202,9 @@ function handleFileSelect(evt) {
|
||||
progress.style.width = '0%';
|
||||
progress.textContent = '0%';
|
||||
|
||||
var extension = String(evt).match(/\.[0-9a-z]+$/i);
|
||||
console.log(extension);
|
||||
console.log(evt);
|
||||
console.log(evt.target.baseURI);
|
||||
//if
|
||||
|
||||
var filename = evt.target.files[0].name;
|
||||
var extension = String(filename.match(/\.[0-9a-z]+$/i));
|
||||
if (extension == ".stl") {
|
||||
reader = new FileReader();
|
||||
reader.onerror = errorHandler;
|
||||
reader.onprogress = updateProgress;
|
||||
@ -228,7 +225,9 @@ function handleFileSelect(evt) {
|
||||
|
||||
// Read in the stl file as a binary string.
|
||||
reader.readAsBinaryString(evt.target.files[0]);
|
||||
//}endif?
|
||||
}
|
||||
else
|
||||
error();
|
||||
}
|
||||
|
||||
function abortRead() {
|
||||
|
Loading…
Reference in New Issue
Block a user