I set the OverwriteExistingFiles attribute to false, but files are being overwritten any way?
Version:2010.2.817.20
Here is my code:
<
telerik:RadAsyncUpload runat="server" ID="AsyncUpload" Skin="Office2007" OverwriteExistingFiles="false" MultipleFileSelection="Automatic" Width="250" OnFileUploaded="RadAsyncUpload1_FileUploaded">
</
telerik:RadAsyncUpload>
6 Answers, 1 is accepted
0
Hi Allan,
The developers of RadAsyncUpload decided not to implement this property on purpose. It is only available in RadUpload.
However you can use the FileUploaded server-side event to easily implement this functionality yourself. Here's how you can do that:
Regards,
Bozhidar
the Telerik team
The developers of RadAsyncUpload decided not to implement this property on purpose. It is only available in RadUpload.
However you can use the FileUploaded server-side event to easily implement this functionality yourself. Here's how you can do that:
protected
void
RadAsyncUpload1_FileUploaded(
object
sender, FileUploadedEventArgs e)
{
string
targetFolder =
"Files"
;
string
targetFileName = Path.Combine(Server.MapPath(targetFolder), e.File.GetName());
if
(!File.Exists(targetFileName))
{
e.File.SaveAs(targetFileName);
}
else
{
// Implement logic
}
}
Regards,
Bozhidar
the Telerik team
Sharpen your .NET Ninja skills! Attend Q1 webinar week and get a chance to win a license! Book your seat now >>
0

Ambu
Top achievements
Rank 1
answered on 09 Feb 2012, 02:58 PM
спасибо.
Is that information in any type of documentation that I could access?
Is that information in any type of documentation that I could access?
0
Hi Allan,
Of course, you can go to our online help, or visit our live demos to see all the functionality of our controls explained and demonstrated.
Regards,
Bozhidar
the Telerik team
Of course, you can go to our online help, or visit our live demos to see all the functionality of our controls explained and demonstrated.
Regards,
Bozhidar
the Telerik team
Sharpen your .NET Ninja skills! Attend Q1 webinar week and get a chance to win a license! Book your seat now >>
0

Ambu
Top achievements
Rank 1
answered on 09 Feb 2012, 03:15 PM
I implemented the code you provided.
The file gets copied over even if the SaveAs function is not called.
The file gets copied over even if the SaveAs function is not called.
0
Hello Allan,
You have to remove the TargetFolder property from the AsyncUpload. When the upload has this property set, it's going to save the file to this location on postback automatically, regardless of what you do inside the FileUploaded event.
Greetings,
Bozhidar
the Telerik team
You have to remove the TargetFolder property from the AsyncUpload. When the upload has this property set, it's going to save the file to this location on postback automatically, regardless of what you do inside the FileUploaded event.
Greetings,
Bozhidar
the Telerik team
Sharpen your .NET Ninja skills! Attend Q1 webinar week and get a chance to win a license! Book your seat now >>
0

Michael
Top achievements
Rank 1
answered on 07 Jan 2014, 06:10 AM
bump