Hi, I am using RadAsyncUpload. After the user select a file I automatically make a postback using Ajax using where btnFileUploaded is not visible.
On server side OnFileUploaded is called and I save the file this way
...which works. But if after that I hit the refresh button in IE (F5) whitout having select a new file then OnFileUploaded is called again and an Exception occurred in SaveAs() because the file doesn't exists anymore.
Do I miss something or is it a bug?
function
asupImage_ClientFileUploaded(sender, args) {
$find(
"<%= RadAjaxManager.GetCurrent(Page).ClientID %>"
).ajaxRequestWithTarget(
'<%= btnFileUploaded.UniqueID %>'
,
''
);
}
On server side OnFileUploaded is called and I save the file this way
protected
void
asupImage_FileUploaded(
object
sender, FileUploadedEventArgs e)
{
string
strAppplicationPath = HttpContext.Current.Request.ApplicationPath;
string
strLocalPath = HttpContext.Current.Request.MapPath(strAppplicationPath);
e.File.SaveAs(strLocalPath + @
"\Temp\"
+ e.File.FileName,
true
);
}
...which works. But if after that I hit the refresh button in IE (F5) whitout having select a new file then OnFileUploaded is called again and an Exception occurred in SaveAs() because the file doesn't exists anymore.
Do I miss something or is it a bug?