always do the extra filetype check clientside
This commit is contained in:
+1
-3
@@ -94,7 +94,6 @@ function fileinputChange () {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
if (fileinput.accept == '') {
|
|
||||||
var filename = fileinput.files[0].name
|
var filename = fileinput.files[0].name
|
||||||
var type = fileinput.files[0].type
|
var type = fileinput.files[0].type
|
||||||
var found = false
|
var found = false
|
||||||
@@ -111,12 +110,11 @@ function fileinputChange () {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!found) {
|
if (!found) {
|
||||||
|
alert("Invalid file: " + filename + "\nPlease select another file.")
|
||||||
fileinfo.textContent = ''
|
fileinfo.textContent = ''
|
||||||
fileinput.value = ''
|
fileinput.value = ''
|
||||||
alert("Invalid file: " + filename)
|
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
fileinfo.textContent = Math.ceil(fileinput.files[0].size / 1024) + ' kB'
|
fileinfo.textContent = Math.ceil(fileinput.files[0].size / 1024) + ' kB'
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user