Hi All,
When using the radupload control, if the file exists I modify the filename as such:
My question is, that .GetName() still returns the original filename and not the modified name, so how can I access the (collection of) original name(s)?
Do I manually have to manage the save event myself? If so are there any examples of doing this?
Kind Regards
When using the radupload control, if the file exists I modify the filename as such:
protected
void RadUpload1_FileExists(object sender, UploadedFileEventArgs e) {
int counter = 1;
UploadedFile file = e.UploadedFile;
string targetFolder = Server.MapPath(RadUpload1.TargetFolder);
string targetFileName = Path.Combine(targetFolder,
file.GetNameWithoutExtension() + counter.ToString() + file.GetExtension());
while (System.IO.File.Exists(targetFileName))
{
counter ++;
targetFileName =
Path.Combine(targetFolder,
file.GetNameWithoutExtension() + counter.ToString() + file.GetExtension());
}
file.SaveAs(targetFileName);
}
My question is, that .GetName() still returns the original filename and not the modified name, so how can I access the (collection of) original name(s)?
Do I manually have to manage the save event myself? If so are there any examples of doing this?
Kind Regards