Docx file is broken after file.save() in a Flask upload #2730
Unanswered
guillermohs9
asked this question in
Q&A
Replies: 1 comment
-
Just to add some info: I installed
So now the |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi!
I'm using an upload function very similar to the one on Flask docs, just that I split the filename and do different things according to the uploaded file extension. Images and PDFs work fine, but when I upload a .docx or .doc file (any valid file, like this one), the file that gets saved on my filesystem is the same size but can't be opened by Word since its broken, and reports a different mimetype (application/zip)
Here's my upload function, there are other elifs with other extension but those are working fine.
Of course the expected output would be a saved file that's identical to the uploaded one.
Environment:
Any help would be appreciated.
Cheers
Beta Was this translation helpful? Give feedback.
All reactions