The structure is approximately as follows:
The user presses the "Generate Report" button, on the server it is generated in a zip file and must be transferred back to the user. How can this be done in flask or through request request?
The structure is approximately as follows:
The user presses the "Generate Report" button, on the server it is generated in a zip file and must be transferred back to the user. How can this be done in flask or through request request?
Do you use nginx ? If yes, then it seems to me that you can save python from uploading the file, when the user requests the server generates an archive and writes it to a specific directory, with a specific name, returns the file name to the client, and in the nginx settings you can assign an alias to the directory, respectively urlu type https://domen.com/you_folder/?file=file_name user can get his file.
Here is an example of the nginx configuration and more
Python and zip
W123gYeb-yus67+datetime it will be difficult, and yes, it depends on the size of the files, on their number and on the number of users - Igor LavrynenkoHere about file transfer
If we talk about the report, then everything is too individual to give any specifics.
Form a question about the report and data archiving. What will be contained in the archive, and if more precisely, which files from the archive should be generated using Flask .
If a csv, xls, pdf file is generated based on data from the database, and there is a lot of data, then it is better to queue such a task.
Source: https://ru.stackoverflow.com/questions/680140/
All Articles