I'm bulding an ASP.NET website where the users can upload their profile picture. I store these images under the App_Data folder and the file paths in the Users table.
So, the question is how should I update the user's profile picture? I mean, what happens if I overwrite the previous file and at the same time a request arrives to get the picture. Should I have some concurrency management? My best solution is generating a file name for the new image(the user record in the database would be updated with this new path as well) and store the old path somewhere else, in order to delete it later. Is this a good idea?