This is a migrated thread and some comments may be shown as answers.

I want to change an uploaded filename if it already exist

1 Answer 111 Views
FileExplorer
This is a migrated thread and some comments may be shown as answers.
Fred
Top achievements
Rank 1
Fred asked on 03 Nov 2011, 07:46 PM
In fileexplorer there is the abilty to upload files. Right now if I upload a file that has the same name as an existing file I get a prompt that tells me the file already exist. What I want to do is give the newfile a unique name and save it. For example I upload file named "Fred.txt" if "Fred.txt" already exist I will try "Fred-01.txt, Fred-02.txt, Fred-03.txt..." until I find one that doesnt exist then save the file with that name. How?

 

<telerik:RadFileExplorer ID="RadFileExplorer1" runat="server" OnClientItemSelected="OnImageSelected" EnableCopy="true" EnableAsyncUpload="true" >

<Configuration MaxUploadFileSize="20480000" />

</telerik:RadFileExplorer>

1 Answer, 1 is accepted

Sort by
0
Dobromir
Telerik team
answered on 04 Nov 2011, 09:13 AM
Hi Fred,

To achieve this you need to override the StoreFile() method of RadFileExplorer's content provider. Please take a look at the following help article for more detailed information on how the content provider works:
Using custom FileBrowserContentProvider

Also, a similar example is available in the following KB article:
Giving the uploaded files unique names

Best wishes,
Dobromir
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now
Tags
FileExplorer
Asked by
Fred
Top achievements
Rank 1
Answers by
Dobromir
Telerik team
Share this question
or