Flask Upload File

This is a basic file upload through Flask. I have used this in my F5 Dashboard project to upload a CSV file that contains the database that is used as the source for what domains require SSL profile updates.

The Process

There are two views for the CSV upload.

  • The file uploader
  • The database refresh

The file uploader takes CSV and saves it as “updated_db.csv”. The user is then redirected to the next page for the database refresh question.

If the user refreshes the database then the database table for domains is cleared and the new CSV data added. They are redirected to the list view to show all the domains. If the user doesn’t want to refresh the database then they are returned to the home page. The database is not changed.

Upload DB

Refresh DB

Leave a Comment

Your email address will not be published. Required fields are marked *