I am using Python-pptx in a web app, that programmatically creates a powerpoint and then allows the user to download at the end. People can upload images, etc, and it inserts it into the powerpoint for them. Works great, however currently I am saving the PowerPoint to the "static" folder and then creating a download link with its file path. Ideally, I want the file to never be saved to the server. This is to prevent privacy issues regarding sensitive information. It would also be great if people didn’t have to log in. Just a simple, secure way to make powerpoints. I tried to get send_file to work to no avail. I think it is the solution though. Here’s what I tried: prs = Presentation() file_name = 'static/' + file_name + '.pptx' root_dir = os.path.dirname(os.getcwd()) path = os.path.join(root_dir, 'project', 'static', 'test.pptx') return send_file(prs, as_attachment=True) # also tried: # return send_file(path, mimetype='applicationvnd.openxmlformats-officedocument.presentationml.presentation', as_attachment=True) # which loads the page, but doesn’t trigger a download,just loads a blank page. # plus, it is referencing a file path which means the file was saved on the server Would appreciate any help! It's my first flask app! Thank you in advance! Continue reading...