0

I am creating a web application via Flask and deployed via Amazon Elastic Beanstalk. My application has the user upload a CSV which I then process to create an output CSV.

Currently, after a user uploads a CSV, I save it like

if file and allowed_file(file.filename):
     filename = 'companies.csv'
     file.save(filename)

so I can process it. I don't need the uploaded file to persist; I just need it for the time to process it and create the output CSV. Note that the filename I use when saving the file is the same for any uploaded file so I have a constant path reference for my other code to process the CSV.

My question is does this work with multiple users concurrently when deployed on Elastic Beanstalk? Let's say multiple users are using the web application at once. They upload a CSV around the same time. Since the name I use to save the uploaded file in the cloud is the same every time ('companies.csv'), is it possible for the file to be overwritten by another user? Or does each user have their own isolated filesystem on the Elastic Beanstalk cloud?

If each user is not isolated, what should I do instead to ensure isolation? Should I upload the file to S3 to process instead?

What I have currently seems to work okay in the development server when the only traffic comes from myself; I'm just worried it won't work out with multiple users at once.

0 Answers0