Home > database >  Is there a way to send a zip file from server via api using flask-python?
Is there a way to send a zip file from server via api using flask-python?

Time:04-02

I need to develop an api in which zip file is stored in server and gets synced at client side when requested by it. Is there a way to do that?

CodePudding user response:

To return a file flask provides the send_file() function.

return send_file('<FILE_PATH>', as_attachment=True, attachment_filename='<FILE_ATTACHMENT_NAME>')

Here the link to the documentation

  • Related