Skip to content

Instantly share code, notes, and snippets.

View byteofprash's full-sized avatar

Prashanth Swaminathan byteofprash

View GitHub Profile
@MattHealy
MattHealy / tools.py
Last active June 10, 2020 20:56
Sample Python code to upload a file to the local server, then upload to AWS S3 with a background task queue
# Adapted from https://github.com/doobeh/Flask-S3-Uploader
# Improved to store the data on the local server and process
# the upload via a celery task queue
from uuid import uuid4
import boto
import os.path
from flask import current_app as app
from werkzeug.utils import secure_filename
from .. import celery