Input type=file should not have a max attribute.

This commit is contained in:
ccd0 2015-11-27 22:26:03 -08:00
parent 12f3ab311b
commit eda4a5145d
2 changed files with 3 additions and 3 deletions

View File

@ -494,10 +494,10 @@ QR =
QR.max_width = +match_max?[1] 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()
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_width_video = QR.max_height_video = 2048

View File

@ -202,7 +202,7 @@ QR.post = class
@readFile()
checkSize: ->
max = QR.nodes.fileInput.max
max = QR.max_size
max = Math.min(max, QR.max_size_video) if /^video\//.test @file.type
if @file.size > max
@fileError "File too large (file: #{@filesize}, max: #{$.bytesToString max})."