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?
Asked
Active
Viewed 1,240 times
0
-
https://pythonhosted.org/Flask-Uploads/#upload-sets – Harben Jul 24 '20 at 01:00
1 Answers
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
-
-
If you like the answer, please accept the answer and/or click the arrow up button. Thanks. – Jürgen Gmach Jul 24 '20 at 19:25