Last post Dec 21, 2016 03:20 AM by Zhi Lv - MSFT
Dec 20, 2016 03:44 PM|aspfun|LINK
My project need to save a jpg file into a folder for later use.
Where is the best place to save this file so that each user will not interrupt each other (Because the name for this file is all the same)?
Dec 20, 2016 03:49 PM|codemovement.pk|LINK
save the file on drive for example if all the files are of the same name save them using GUID
flower.jpeg will change to 99fb0bac-5ac1-4c05-8694-a32f8bc23dd4.jpeg
you can achieve this by using
and in database save the orignal name and the name that you used to save the file so you can show the orignal name for users
Dec 21, 2016 03:20 AM|Zhi Lv - MSFT|LINK
As codemovement.pk said, you could create a new unique file name by adding a GUID to the original name.
Please refer to the following code:
fileName = Guid.NewGuid() + fileName;
More details, see: