mistercrunch commented on a change in pull request #9923:
URL: 
https://github.com/apache/incubator-superset/pull/9923#discussion_r430870612



##########
File path: superset/views/database/views.py
##########
@@ -65,9 +65,15 @@ def certificate_form_validator(_, field: StringField) -> 
None:
 
 def upload_stream_write(form_file_field: "FileStorage", path: str):
     chunk_size = app.config["UPLOAD_CHUNK_SIZE"]
+    max_size = app.config["UPLOAD_MAX_SIZE"] or float("inf")
     with open(path, "bw") as file_description:
         while True:
             chunk = form_file_field.stream.read(chunk_size)
+            max_size -= len(chunk)
+            if max_size < 0:
+                raise UploadOverFlowException(
+                    _("Upload Max Size %(size)s", 
size=app.config["UPLOAD_MAX_SIZE"])

Review comment:
       NIT: "Exceeded the upload maximum size of %(size)s bytes"




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to