Best Flask open-source libraries and packages

Handling file uploads in flask

How to safely add uploaded files to your flask database and render it
Updated 10 months ago

Flask File Uploads

One feature of web applications is the ability to upload a file to an application. It is very common to see applications allow users to upload images for their avatar among other file types. This application shows how that feature can be implemented in Flask.

File Upload

Features

  • File Upload

Tools Used

  • Flask Framework
  • Twitter Bootstrap for styling
  • Python3 for programming
  • Flask-WTF for form creation

Contributors

Testing

To test the project, youcan clone this repo to your local machine by running the command below in your terminal:

$ git clone git@github.com:GitauHarrison/handling-file-uploads-in-flask.git

Create and activate your virtual environment before running the flask server:

$ mkvirtualenv file_upload  # I am using virtualenvwrapper 

Install used dependancies by running:

(file_upload)$ pip3 install -r requirements.txt

Run the application:

(file_upload)$ flask run

Deployment

Learn

If you would like to see how the application can be built from scratch, here is an article you can refer to.

References