TransWikia.com

Flask API for uploading a video

Stack Overflow Asked on December 25, 2021

I like to write an api that accept from the user a video via a post command. Any body can let me know how can I use Flask-Uploads for extensions mp4 or other video extensions?

One Answer

The version of Flask-Uploaded on PyPi is broken since February 2020.

You can use the drop in replacement: https://pypi.org/project/Flask-Reuploaded/

When you want a file extension, which is not contained in a pre-defined set, you just can create your own one.

e.g.

VIDEOS = tuple("mp4 mov")

and then configure Flask-Reuploaded as described in the documentation, i.e

videos = UploadSet('videos', VIDEOS)

If you do not want to use Flask-Reuploaded, there is a very good blog post by Miguel Grinberg explaining all the details - without using an upload extension:

https://blog.miguelgrinberg.com/post/handling-file-uploads-with-flask

Answered by Jürgen Gmach on December 25, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP