I am creating a web app in Flask that accepts an input dataset and an algorithm within an imported python script then manipulates it. The script generates and physically saves a .csv table ("zscore_data.csv") and a .png image ("zplot.png") which the user can then download. So essentially these are overwritten each time a new dataset is uploaded.
What if multiple users upload their datasets at the same time? Will user X accidentally download the files generated for user Y? (There are no user accounts associated with the users, the files are just stored in a downloads folder).
I am worried this will later cause problems. Any help would be appreciated!
To illustrate, in my script.py "zscore_data.csv" is saved to static/downloads:
zscore_csv = zscore_df.to_csv("static/downloads/zscore_data.csv", index=False)
In results.html a download link is provided:
<a href="{{ url_for('static', filename='downloads/zscore_data.csv') }}" class="link" download><strong>Z-Score Data (.csv)</strong></a>