0

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?

Jürgen Gmach
  • 5,366
  • 3
  • 20
  • 37
Diana
  • 1
  • 1

1 Answers1

1

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

Jürgen Gmach
  • 5,366
  • 3
  • 20
  • 37