Hi,
in a single asp.net page, i put 2 RadUpload "prometheus" control. i didn't set TargetFolder and TargetPhysicalFolder, because i want to handle the upload myself. I want to save files using unique file name that i generate myself.
the problem is that when i use this unique file name, not all files that are uploaded are saved on the disk. I simulate this several time, I upload 5 files and only 3 or 4, even only 2 of them are saved on the harddisk, but when I use the original file name of the files uploaded, all of them are saved successfully on the harddisk. strangely, if I run it on debug mode (pressing F5) and go through the code line by line with F10, everything is working fine, all files are saved with unique filename.
this is my code behind that handles the upload:
if (RadUpload1.UploadedFiles.Count > 0)
{
foreach (Telerik.Web.UI.UploadedFile file1 in RadUpload1.UploadedFiles)
{
string newFilename = Tools.generateUniqueFilename() + file1.GetExtension();
file1.SaveAs(Path.Combine(path, newFilename));
images.Add(file1.FileName, file1);
Literal1.Text += file1.FileName + " success<br/>";
}
}
if (RadUpload2.UploadedFiles.Count > 0)
{
foreach (Telerik.Web.UI.UploadedFile file2 in RadUpload2.UploadedFiles)
{
string newFilename = Tools.generateUniqueFilename() + file2.GetExtension();
file2.SaveAs(Path.Combine(path, newFilename));
images.Add(file2.FileName, file2);
Literal1.Text += file2.FileName + " success<br/>";
}
}
I appreciate for any help.
regards,
arief
in a single asp.net page, i put 2 RadUpload "prometheus" control. i didn't set TargetFolder and TargetPhysicalFolder, because i want to handle the upload myself. I want to save files using unique file name that i generate myself.
the problem is that when i use this unique file name, not all files that are uploaded are saved on the disk. I simulate this several time, I upload 5 files and only 3 or 4, even only 2 of them are saved on the harddisk, but when I use the original file name of the files uploaded, all of them are saved successfully on the harddisk. strangely, if I run it on debug mode (pressing F5) and go through the code line by line with F10, everything is working fine, all files are saved with unique filename.
this is my code behind that handles the upload:
if (RadUpload1.UploadedFiles.Count > 0)
{
foreach (Telerik.Web.UI.UploadedFile file1 in RadUpload1.UploadedFiles)
{
string newFilename = Tools.generateUniqueFilename() + file1.GetExtension();
file1.SaveAs(Path.Combine(path, newFilename));
images.Add(file1.FileName, file1);
Literal1.Text += file1.FileName + " success<br/>";
}
}
if (RadUpload2.UploadedFiles.Count > 0)
{
foreach (Telerik.Web.UI.UploadedFile file2 in RadUpload2.UploadedFiles)
{
string newFilename = Tools.generateUniqueFilename() + file2.GetExtension();
file2.SaveAs(Path.Combine(path, newFilename));
images.Add(file2.FileName, file2);
Literal1.Text += file2.FileName + " success<br/>";
}
}
I appreciate for any help.
regards,
arief