Skip to content
Myr

fix grammar (#3769)

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by miquelvir · committed by GitHub · parent de464c0 · Browse files · 1 file+7 added−8 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+7 added−8 removed

  • other:+7 added−8 removed

1 file+7 added−8 removed

modified:docs/patterns/fileuploads.rst+7 added-8 removed
53 unmodified lines
54 if 'file' not in request.files:55 flash('No file part')56 return redirect(request.url)57 file = request.files['file']58 # if user does not select file, browser also59 # submit an empty part without filename58 # If the user does not select a file, the browser submits an59 # empty file without a filename.60 if file.filename == '':61 flash('No selected file')62 return redirect(request.url)63 if file and allowed_file(file.filename):
70 unmodified lines
134135.. versionadded:: 0.6136137So how exactly does Flask handle uploads? Well it will store them in the138webserver's memory if the files are reasonable small otherwise in a138webserver's memory if the files are reasonably small, otherwise in a139temporary location (as returned by :func:`tempfile.gettempdir`). But how140do you specify the maximum file size after which an upload is aborted? By141default Flask will happily accept file uploads to an unlimited amount of141default Flask will happily accept file uploads with an unlimited amount of142memory, but you can limit that by setting the ``MAX_CONTENT_LENGTH``143config key::144145 from flask import Flask, Request
20 unmodified lines
166--------------------167168A while ago many developers had the idea to read the incoming file in169small chunks and store the upload progress in the database to be able to170poll the progress with JavaScript from the client. Long story short: the171client asks the server every 5 seconds how much it has transmitted172already. Do you realize the irony? The client is asking for something it173should already know.170poll the progress with JavaScript from the client. The client asks the171server every 5 seconds how much it has transmitted, but this is172something it should already know.173174An Easier Solution175------------------176
11 unmodified lines