https://github.com/pj8912/flask-file-upload
Uploading files using flask and mysql/sqlite
https://github.com/pj8912/flask-file-upload
file-upload flask html5 mysql python
Last synced: about 2 months ago
JSON representation
Uploading files using flask and mysql/sqlite
- Host: GitHub
- URL: https://github.com/pj8912/flask-file-upload
- Owner: pj8912
- Created: 2023-06-01T12:43:15.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2023-06-29T16:21:53.000Z (about 3 years ago)
- Last Synced: 2025-06-11T15:01:53.167Z (about 1 year ago)
- Topics: file-upload, flask, html5, mysql, python
- Language: Python
- Homepage: https://github.com/pj8912/flask-file-upload
- Size: 74.2 KB
- Stars: 0
- Watchers: 2
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README

# File Uploading in Flask
Uploading files using flask and mysqlab
Two ways of uploading files in Flask,
- Only directly into the folder
- Into database from the folder
Files are saved in database as binaries, so the uploaded file is converted to binary before upload and saved as a `blob` in the database.
## Requirements
- Python `3.10.6`
## Install
- **Clone **
```
https://github.com/pj8912/flask-file-upload.git
```
- Create `virtual environment` and **activate**
- ** Install requirements **
```
pip install requirements.txt
```
## Configuration
- I used mysql for this project
- Create an `.env` and add appropiate values for your mysql setup
- `.env` variables :
- DB_HOST=
- DB_USERNAME=
- DB_PWD=
- DB_NAME=file-test
Host, username, password and database name
My database name is `file-test`
- SQL file
Import sql file from `mysql/file-test.sql`
## Run
```
python app.py
```