ai-cfia / nachet-backend

A flask-based backend for Nachet to handle Azure endpoint and Azure storage API requests from the frontend.
MIT License
1 stars 3 forks source link

Increase content length for uploads #64

Closed SonOfLope closed 3 months ago

SonOfLope commented 4 months ago

@amirardalan9473 flagged that he cannot upload a file with 43mb size. We initially thought it was related to the ingress controller that hosts the backend but looking at the logs from the backend we see that its the web server that is giving the issue.

Screenshot from nachet-backend logs (thank you argoCD) : image Looking at the code, I see we are using Quart as a web framework. Parsing default values i see that the limit for content is set as 16 mb : image reference : https://github.com/pallets/quart/blob/8a0cdd5a650c29d036dfec3000818b0e06ce3e0c/src/quart/config.py#L19

We would need to increase this value to at least 200mb by doing something like :

from flask import Flask, request

app = Flask(__name__)

app.config['MAX_CONTENT_LENGTH'] = 200 * 1024 * 1024
SonOfLope commented 4 months ago

for testing with a file, simply ask Amir or me and we'll provide it.

MaxenceGui commented 4 months ago

for testing with a file, simply ask Amir or me and we'll provide it.

@SonOfLope I would like to have a test file if you can provide one :)

MaxenceGui commented 4 months ago

@amirardalan9473 flagged that he cannot upload a file with 43mb size. We initially thought it was related to the ingress controller that hosts the backend but looking at the logs from the backend we see that its the web server that is giving the issue.

Screenshot from nachet-backend logs (thank you argoCD) : image Looking at the code, I see we are using Quart as a web framework. Parsing default values i see that the limit for content is set as 16 mb : image reference : https://github.com/pallets/quart/blob/8a0cdd5a650c29d036dfec3000818b0e06ce3e0c/src/quart/config.py#L19

We would need to increase this value to at least 200mb by doing something like :

from flask import Flask, request

app = Flask(__name__)

app.config['MAX_CONTENT_LENGTH'] = 200 * 1024 * 1024

The assumption is right. I add this line:

app.config["MAX_CONTENT_LENGTH"] = 200 * 1024 * 1024  # 200MB

The system will be able to process the picture. However, tiff image is not displayed by the frontend relating to

rngadam commented 3 months ago

related to #58