Python Flask application to receive and save images over POST requests.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
This repo is archived. You can view files and clone it, but cannot push or open issues/pull-requests.
BBaoVanC 70e84ec8f0
Remove unused flask Response import
8 months ago
.github Add GitHub-specific which links Gitea 11 months ago
.gitignore Update .gitignore 8 months ago
LICENSE Initial commit 11 months ago Fix installation instructions 8 months ago Change usage of str.format() to f-strings 10 months ago Add newline after block comments at beginning 11 months ago Remove unused flask Response import 8 months ago Change usage of str.format() to f-strings 10 months ago
requirements.txt Strip EXIF from image before saving 8 months ago Add proper shebangs and block comments 11 months ago
uwsgi.ini.default Increase processes in uwsgi.ini.default 11 months ago


What is imgupload?

imgupload is a Flask + uWSGI application to serve as an all-purpose image/file uploader over POST requests.


Where can I send bug reports and feature requests?

You can create an issue here.

How do I use this program?

See Installation

I want to make a pull request. Where should I do that?

First, fork this repository. If you don't have an account on my Gitea site yet, you can either create one, or sign in using your GitHub account. Commit your changes to your fork, and then create a pull request.


Using uWSGI

Note: replace www-data with whatever user your webserver runs as.

  1. Go to /srv: cd /srv
  2. Clone the repository: git clone
  3. Change ownership of /srv/imgupload: sudo chown www-data:www-data /srv/imgupload
  4. Enter www-data user: sudo su www-data
  5. Change directories to /srv/imgupload: cd /srv/imgupload
  6. Checkout the version you want (replace [version] with desired version tag: git checkout [version]
  7. Enter the imgupload directory: cd imgupload
  8. Create a virtualenv: python3 -m venv env
  9. Enter the virtualenv: source env/bin/activate
  10. Install dependencies: python3 -m pip install -r requirements.txt
  11. Leave the www-data user: exit
  12. Copy the default uWSGI configuration: sudo cp /srv/imgupload/uwsgi.ini.default /etc/uwsgi/apps-available/imgupload.ini
  13. Modify /etc/uwsgi/apps-available/imgupload.ini to your preferences
  14. Enable imgupload: sudo ln -s /etc/uwsgi/apps-available/imgupload.ini /etc/uwsgi/apps-enabled/
  15. Restart uWSGI: sudo systemctl restart uwsgi
  16. Set up your webserver to proxy the uwsgi.sock

Example NGINX location block:

location /upload {
    include uwsgi_params;
    uwsgi_pass unix:/srv/imgupload/uwsgi.sock;
    client_max_body_size 25M;

Using Flask development server


git clone
cd imgupload
python3 -m venv env
source env/bin/activate
pip3 install -r requirements.txt


flask run


imgupload is licensed under the GPLv3 license. For more information, please refer to LICENSE