Input type=file should not have a max attribute.
This commit is contained in:
parent
12f3ab311b
commit
eda4a5145d
@ -494,10 +494,10 @@ QR =
|
|||||||
QR.max_width = +match_max?[1] or 10000
|
QR.max_width = +match_max?[1] or 10000
|
||||||
QR.max_height = +match_max?[2] or 10000
|
QR.max_height = +match_max?[2] or 10000
|
||||||
|
|
||||||
nodes.fileInput.max = $('input[name=MAX_FILE_SIZE]')?.value or '0'
|
QR.max_size = +($('input[name=MAX_FILE_SIZE]')?.value or '0')
|
||||||
|
|
||||||
scriptData = Get.scriptData()
|
scriptData = Get.scriptData()
|
||||||
QR.max_size_video = if (m = scriptData.match /\bmaxWebmFilesize *= *(\d+)\b/) then +m[1] else +nodes.fileInput.max
|
QR.max_size_video = if (m = scriptData.match /\bmaxWebmFilesize *= *(\d+)\b/) then +m[1] else QR.max_size
|
||||||
QR.max_comment = if (m = scriptData.match /\bcomlen *= *(\d+)\b/) then +m[1] else 2000
|
QR.max_comment = if (m = scriptData.match /\bcomlen *= *(\d+)\b/) then +m[1] else 2000
|
||||||
|
|
||||||
QR.max_width_video = QR.max_height_video = 2048
|
QR.max_width_video = QR.max_height_video = 2048
|
||||||
|
|||||||
@ -202,7 +202,7 @@ QR.post = class
|
|||||||
@readFile()
|
@readFile()
|
||||||
|
|
||||||
checkSize: ->
|
checkSize: ->
|
||||||
max = QR.nodes.fileInput.max
|
max = QR.max_size
|
||||||
max = Math.min(max, QR.max_size_video) if /^video\//.test @file.type
|
max = Math.min(max, QR.max_size_video) if /^video\//.test @file.type
|
||||||
if @file.size > max
|
if @file.size > max
|
||||||
@fileError "File too large (file: #{@filesize}, max: #{$.bytesToString max})."
|
@fileError "File too large (file: #{@filesize}, max: #{$.bytesToString max})."
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user