diff --git a/api/trotamundos.py b/api/trotamundos.py index 0d323f8..d34f5d1 100644 --- a/api/trotamundos.py +++ b/api/trotamundos.py @@ -11,8 +11,8 @@ -# Set the maximum content length to 10 MB (for example) -app.config['MAX_CONTENT_LENGTH'] = 10 * 1024 * 1024 # 10 MB in bytes +# Set the maximum content length to 100 MB (for example) +app.config['MAX_CONTENT_LENGTH'] = 100 * 1024 * 1024 # 100 MB in bytes months = ['enero', 'febrero', 'marzo', 'abril', 'mayo', 'junio', 'julio', 'agosto', 'septiembre', 'octubre', 'noviembre', 'diciembre'] @@ -141,3 +141,4 @@ def publish(): if __name__ == "__main__": app.run(host='127.0.0.1', port=8081) + diff --git a/editor/js/trotamundos.js b/editor/js/trotamundos.js index 095bd8a..f23f4bf 100644 --- a/editor/js/trotamundos.js +++ b/editor/js/trotamundos.js @@ -800,7 +800,13 @@ function publishImage(imageObject) { method: "POST", body: formData }) - .then(response => response.json()) + .then(async response => { + if (response.ok) { + return response.json() + } else { + throw new Error(await response.text()); + } + }) .then(data => { console.log(data.message); deleteImageById(imageObject.id); @@ -817,7 +823,6 @@ function publishImages() { imgPromise.onsuccess = function (event) { const allElements = event.target.result; - alert("Uploading images: " + allElements.length); allElements.forEach(function (img) { publishImage(img); })