Aurigma Forums
»
Upload Suite
»
Discussions – ActiveX/Java Uploader
»
Preventing the upload of duplicate files in ASP.NET (C#)
Rank: Newbie
Groups: Member
Joined: 9/13/2010(UTC) Posts: 2
|
Hello, I would like to be able to prevent users from overwriting a file on the destination folder but I do not understand how to alter the code-behind to achieve this. I think that the ImageUploader1_FileUploaded class, called by the OnFileUploaded property, is a good candidate as a function that could contain the duplicate file checking code. After reading the documentation, I think that the fileOverwrite property in the Nirvanix class would do the job, but I am not sure how to implement this function to perform the check. Any help on this issue would be very much appreciated, I have included a copy of the function that I have been working on. Ross protected void ImageUploader1_FileUploaded(object sender, Aurigma.ImageUploader.FileUploadEventArgs e) { string catalogPath = "C:/Documents and SettingsDesktop/Test_folder/"; Aurigma.ImageUploader.SourceFileInfo sourceFile = e.SourceFile; //sourceFile.Save(Server.MapPath(catalogPath) + sourceFile.FileName); Aurigma.ImageUploader.Nirvanix.NirvanixExtender ; sourceFile.Save(catalogPath + sourceFile.FileName); } Edited by user Monday, September 13, 2010 1:29:20 AM(UTC)
| Reason: Not specified
|
|
|
|
Rank: Advanced Member
Groups: Joined: 5/29/2010(UTC) Posts: 1,310
Thanks: 8 times Was thanked: 111 time(s) in 111 post(s)
|
Hello Ross, Thanks for contacting us. As far as I understand, you want prevent uploading duplicate files. I created simple application using Image Uploader. It allows uploading images, but if there is duplicate image (with the same name as image, which is located on the server) it will not be saved. I attached this sample for your reference. Please download and try it out. If you have any additional questions, please feel free to let me know. |
Best regards, Dmitry Obukhov
Technical Support. Aurigma, Inc.
|
|
|
|
Rank: Newbie
Groups: Member
Joined: 9/13/2010(UTC) Posts: 2
|
Thank you very much for the help Dmitry - that solved the problem right away!
|
|
|
|
Aurigma Forums
»
Upload Suite
»
Discussions – ActiveX/Java Uploader
»
Preventing the upload of duplicate files in ASP.NET (C#)
Forum Jump
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.