increase the limit for concurrent file uploads from 4 to 8

pull/134/head
Aevann 2023-02-26 14:19:30 +02:00
parent ff45099da2
commit 663cdde1f4
4 changed files with 7 additions and 7 deletions

View File

@ -247,9 +247,9 @@ function escapeHTML(unsafe) {
function changename(s1,s2,textarea) { function changename(s1,s2,textarea) {
console.log('nigg') console.log('nigg')
const files = document.getElementById(s2).files; const files = document.getElementById(s2).files;
if (files.length > 4) if (files.length > 8)
{ {
alert("You can't upload more than 4 files at one time!") alert("You can't upload more than 8 files at one time!")
document.getElementById(s2).value = null document.getElementById(s2).value = null
return return
} }

View File

@ -66,9 +66,9 @@ function hide_image() {
document.onpaste = function(event) { document.onpaste = function(event) {
files = structuredClone(event.clipboardData.files); files = structuredClone(event.clipboardData.files);
if (files.length > 4) if (files.length > 8)
{ {
alert("You can't upload more than 4 files at one time!") alert("You can't upload more than 8 files at one time!")
return return
} }

View File

@ -27,7 +27,7 @@ def media_ratelimit(v):
def process_files(files, v, body): def process_files(files, v, body):
if g.is_tor or not files.get("file"): return body if g.is_tor or not files.get("file"): return body
files = files.getlist('file')[:4] files = files.getlist('file')[:8]
if files: if files:
media_ratelimit(v) media_ratelimit(v)
@ -234,7 +234,7 @@ def process_dm_images(v, user, body):
if not request.files.get("file") or g.is_tor or not get_setting("dm_images"): if not request.files.get("file") or g.is_tor or not get_setting("dm_images"):
return '' return ''
files = request.files.getlist('file')[:4] files = request.files.getlist('file')[:8]
for file in files: for file in files:
if '<file>' not in body: if '<file>' not in body:
abort(400, "Missing <file> in text!") abort(400, "Missing <file> in text!")

View File

@ -153,7 +153,7 @@ def comment(v:User):
body, _, options, choices = sanitize_poll_options(v, body, False) body, _, options, choices = sanitize_poll_options(v, body, False)
if request.files.get("file") and not g.is_tor: if request.files.get("file") and not g.is_tor:
files = request.files.getlist('file')[:4] files = request.files.getlist('file')[:8]
if files: if files:
media_ratelimit(v) media_ratelimit(v)