Hello ,
am using RadAsyncUpload .
below is my code
am using RadAsyncUpload .
below is my code
//To validate upload control.
function
validationFailed(sender, eventArgs) {
$telerik.$(
".ErrorHolder"
).html(
""
);
$(
".ErrorHolder"
).append(
"<p>Attachment exceeding the maximum total size for the file '"
+ eventArgs.get_fileName() +
"'.</p>"
).fadeIn(
"slow"
);
}
//Remove Error Message.
function
RemoveErrorMessage(sender, eventArgs) {
$(
".ErrorHolder"
).fadeOut(
"slow"
);
}
<
telerik:RadAsyncUpload
runat
=
"server"
ID
=
"RadAsyncUpload"
MultipleFileSelection
=
"Disabled"
TemporaryFolder
=
"attachments"
TargetFolder
=
"attachments"
MaxFileSize
=
"524288"
OnFileUploaded
=
"RadAsyncUpload_FileUploaded"
OnClientValidationFailed
=
"validationFailed"
MaxFileInputsCount
=
"1"
OnClientFileUploadRemoved
=
"RemoveErrorMessage"
>
</
telerik:RadAsyncUpload
>
public
void
RadAsyncUpload_FileUploaded(
object
sender, FileUploadedEventArgs e)
{
Label fileName =
new
Label();
fileName.Text = e.File.FileName;
string
strFileName =
string
.Empty;
if
(itotalBytes < iMaxTotalBytes)
{
// Total bytes limit has not been reached, accept the file
e.IsValid =
true
;
itotalBytes += e.File.ContentLength;
}
else
{
// Limit reached, discard the file
e.IsValid =
false
;
}
if
(e.IsValid)
{
string
targetFolder = RadAsyncUpload.TargetFolder;
strFileName = e.File.FileName;
//If same file uploaded again then it will overwrite.
e.File.SaveAs(Path.Combine(Server.MapPath(targetFolder), strFileName));
}
}
It creates RadUploadTestFile file by default in attachment folder.
Why so?? Can we avoid that?
Plus it creates some wired ext file which i upload ... :(