Click here to Skip to main content
15,908,581 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
had two customers yesterday that each uploaded a file to my website. the files were different in size, but had the same name and came from similar physical location (Philly - our data center is in Dallas). both files were .txt, one was 10KB and the other was 16KB. Both were uploaded within 3 seconds of each other. The last file to upload replaced the first file, so i ended up with 2 identical files. My research tells me that something within .NET or IIS renames files using an 8 digit random chars as part of the upload widget, before the code renaming takes over - my best guess as to what happened was that these files magically got named the same 8 random digits. We have been in business for 10 years and have thousands of uploads every day and this is the first time was have experienced this problem (that we know of). during file processing we rename the file using userid combined with datetime stamp and a few other keys (in this case, the file was already overwritten before being handed off to this renaming process).

any other ideas on what could have happened here and/or some insight as to how to better handle this? seems like a one-in-a-million scenario, which isnt going to kill our business but as a developer i hate not knowing why something happened and/or not knowing how to fix it.

thanks in advance for any insight!
Posted
Comments
Sergey Alexandrovich Kryukov 1-Oct-13 11:36am    
You are right, but, I would say, not enough information.
—SA
idenizeni 1-Oct-13 11:48am    
If it were me I would want to understand how the upload widget determines the 'random' filename. My first guess would be the widget uses the date and/or time to generate the filename and doesn't consider the seconds part of the time.
We have to check the code.
MCY 2-Oct-13 16:48pm    
I prefer to use 32 character GUIDs combined with other stuff as file names in these kind of applications.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900