0

I am creating an angular 2 app with python Flask as back end. Flask is only being used as a REST API. I use celery in the backend for tasks that take a lot of time.

One of the requirements I have now is that I need to download a large file from the angular app as it is being created in the back end. When a user makes the request... flask starts a celery job which calls a command line application in linux which creates the file .... but I don't want to wait till the whole file is created for the download to start .. I want the download to start as the file is being created. How can I achieve this in my current angular -> Flask REST API -> Celery setup?

It is different than the question here Create and download a CSV file from a Flask view

because:

  1. The file is being created by an external program ... not python
  2. The answer to the question is a "blocking" ... My files are large .. the python app should not hang till the download is complete
jean
  • 4,159
  • 4
  • 31
  • 52
user3268403
  • 203
  • 2
  • 14
  • I doubt that there's a way to download each part of the file as it is created, but you can probably access part of the file before the complete file is written. You'd just want to constantly check for updates – ChootsMagoots Mar 16 '18 at 17:17
  • Thanks david. I think the log file question is similar to one I asked. Sorry for asking a duplicate – user3268403 Mar 16 '18 at 17:45

0 Answers0