Skip to content

Commit

Permalink
Fix file upload size
Browse files Browse the repository at this point in the history
  • Loading branch information
pabloalba committed Mar 29, 2024
1 parent fd012b0 commit 53f98c2
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
5 changes: 3 additions & 2 deletions api/trotamundos.py
Original file line number Diff line number Diff line change
Expand Up @@ -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']

Expand Down Expand Up @@ -141,3 +141,4 @@ def publish():

if __name__ == "__main__":
app.run(host='127.0.0.1', port=8081)

9 changes: 7 additions & 2 deletions editor/js/trotamundos.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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);
})
Expand Down

0 comments on commit 53f98c2

Please sign in to comment.