It gives the error: 'ZipFile' does not have the buffer interface. How do I send this zip file object to the user with Flask? This is my code: app. ZipFile 'capsule. ZipInfo individualFile['fileName'] data. Improve this question. See also: stackoverflow. Add a comment. Active Oldest Votes. Improve this answer. Cleb: you mean you have complete filenames in strings and those files exist on disk? Then use the zf. Thanks, that's indeed what I ended up with also using this answer to get only the files and avoid the entire directory structure.
MartijnPieters I tried your piece of code and I generate an archive but which seems invalid. Do you have any idea about that? Show 2 more comments. Sign up or log in Sign up using Google. Sign up using Facebook. Sign up using Email and Password.
Post as a guest Name. Email Required, but never shown. The Overflow Blog. Podcast Who is building clouds for the independent developer?
Exploding turkeys and how not to thaw your frozen bird: Top turkey questions Featured on Meta. Now live: A fully responsive profile. Reducing the weight of our footer. Related Hot Network Questions.
Question feed. Any way to clear the cache from Flask? Your email address will not be published. Roy Tutorials Technical… Theoretical… Practical…. Introduction Here I am going to show a simple example on how to download a file from web application using Python Flask.
Prerequisites Python 3. Project Directory First step is to create a project root directory under which I will put all the required files for the project. Configuring Flask Create the below app.
UI Template Now create a download. Testing the Application Now navigate to the project root directory from command line tool and execute the command python main.
Source Code Download. You have to stop browser cache using http header response. Leave a Reply Cancel reply Your email address will not be published.
0コメント