简体   繁体   中英

Python - save BytesIO in database

So I am trying to create a binary file and save it into my database. I am using REDIS and SQLALCHEMY as a framework for my database. I can use send_file to send the actual file whenever the user accesses a URL but how do I make sure that the file is saved in the route and it could stay there every time a user accesses the URL.

I am sending the file from a client-python it's not in my directory

what I need in a nutshell is to save the file from the client-python to a database to "downloadable" it to the browser-client so it would actually be available for the browser-client is there any way of doing this? Maybe a different way that I didn't think about

I had to encode the data with base64, send it to the database and then decode it and send the file as binary data.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM