From 598c56c4983b33cbd9178f28516ebee33dd10fdd Mon Sep 17 00:00:00 2001 From: miquelvir <41950283+miquelvir@users.noreply.github.com> Date: Mon, 28 Sep 2020 15:21:59 +0200 Subject: [PATCH] fix grammar (#3769) --- docs/patterns/fileuploads.rst | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/docs/patterns/fileuploads.rst b/docs/patterns/fileuploads.rst index 9fc73304..64643d8a 100644 --- a/docs/patterns/fileuploads.rst +++ b/docs/patterns/fileuploads.rst @@ -55,8 +55,8 @@ the file and redirects the user to the URL for the uploaded file:: flash('No file part') return redirect(request.url) file = request.files['file'] - # if user does not select file, browser also - # submit an empty part without filename + # If the user does not select a file, the browser submits an + # empty file without a filename. if file.filename == '': flash('No selected file') return redirect(request.url) @@ -135,10 +135,10 @@ Improving Uploads .. versionadded:: 0.6 So how exactly does Flask handle uploads? Well it will store them in the -webserver's memory if the files are reasonable small otherwise in a +webserver's memory if the files are reasonably small, otherwise in a temporary location (as returned by :func:`tempfile.gettempdir`). But how do you specify the maximum file size after which an upload is aborted? By -default Flask will happily accept file uploads to an unlimited amount of +default Flask will happily accept file uploads with an unlimited amount of memory, but you can limit that by setting the ``MAX_CONTENT_LENGTH`` config key:: @@ -167,10 +167,9 @@ Upload Progress Bars A while ago many developers had the idea to read the incoming file in small chunks and store the upload progress in the database to be able to -poll the progress with JavaScript from the client. Long story short: the -client asks the server every 5 seconds how much it has transmitted -already. Do you realize the irony? The client is asking for something it -should already know. +poll the progress with JavaScript from the client. The client asks the +server every 5 seconds how much it has transmitted, but this is +something it should already know. An Easier Solution ------------------