Hi,
I am trying to perform an upload with no post back, so I am using the handler. Telerik v4.0.30319
The code works, but for some reason it split the file and upload only 2MB of it.
public class myHandler : AsyncUploadHandler, System.Web.SessionState.IRequiresSessionState
{
protected override IAsyncUploadResult Process(UploadedFile file, HttpContext context, IAsyncUploadConfiguration configuration, string tempFileName)
{
string targetFolder = context.Server.MapPath("~/Uploads/");
string fileName = file.GetName();
file.SaveAs(targetFolder + fileName);
return CreateDefaultUploadResult<UploadedFileInfo>(file);
}
}
JS code
<script type="text/javascript">
function OnClientFileUploadFailed(sender, args) {
}
function OnClientValidationFailed(sender, args) {
}
var gridfileName = '';
function OnClientFilesUploaded(sender, args) {
GetgridIDfieldName(gridfileName);
}
function OnClientFilesUploading(sender, args) {
gridfileName=args.get_fileName();
}
</script>
<telerik:RadAsyncUpload
ID="RadAsyncUpload1"
OnClientFileUploadFailed="OnClientFileUploadFailed"
OnClientValidationFailed="OnClientValidationFailed"
OnClientFilesUploaded="OnClientFilesUploaded"
OnClientFileUploading="OnClientFilesUploading"
HttpHandlerUrl="~/myHandler.ashx"
TargetFolder="~/Uploads"
DisableChunkUpload="true"
MaxFileSize="10485760"
RenderMode="Lightweight"
runat="server">
</telerik:RadAsyncUpload>
Note: The code do not create temp file at "\App_Data\RadUploadTemp" it directly upload the file to the Uploads folder.
Any help is much appreciated.
Regards,
Omar