Hi,
The OnFileUploaded event is not firing. Am i missing something?
aspx
<telerik:RadCloudUpload
ID="CU"
runat="server"
MultipleFileSelection="Disabled"
ProviderType="Azure"
MaxFileSize="2147483648"
OnFileUploaded="CU_FileUploaded"
OnClientUploadFailed="OnClientUploadFailed"
AllowedFileExtensions=".pdf"
httpHandlerUrl="~/AzureUploadHandler.ashx">
</telerik:RadCloudUpload>
aspx.cs
protected async void AU_FileUploaded( object sender, Telerik.Web.UI.FileUploadedEventArgs e ) {
DateTime startDate = DateTime.Now;
Bll.BfxFiles.SaveFileAsync( Sys.Config.DomainId, 0, 1, e.File.InputStream, e.File.FileName );
AsyncUploadLabel.ForeColor = System.Drawing.Color.Green;
AsyncUploadLabel.Text = string.Format( "File '{0}' uploaded successfully to Azure BLOB storage.<br/>Start: {1}<br/>End: {2}<br/>Size: {3}",
e.File.FileName, startDate.ToString(), DateTime.Now.ToString(), e.File.ContentLength.ToString() );
}
handler
<%@ WebHandler Language="C#" Class="AzureUploadHandler" %>
using System;
using System.Web;
public class AzureUploadHandler : Telerik.Web.UI.CloudUploadHandler, System.Web.SessionState.IReadOnlySessionState {
public override void SetKeyName(object sender, Telerik.Web.UI.CloudUpload.SetKeyNameEventArgs e) {
if ( HttpContext.Current.Session["SelectedBfxFileId"] == null ) {
HttpContext.Current.Response.Redirect( "~/Login.aspx?m=1" ); // session timed out
}
else {
try {
int bfxFileId = Convert.ToInt32( HttpContext.Current.Session["SelectedBfxFileId"] );
if ( bfxFileId == 0 ) {
HttpContext.Current.Response.Redirect( "~/Error.aspx?e=1" ); // invalid bfxFileId
}
else {
e.KeyName = Bll.BfxFiles.BuildBlobName( bfxFileId, e.OriginalFileName );
}
}
catch ( Exception ex ) {
throw ex;
}
}
}
}
The OnFileUploaded event is not firing. Am i missing something?
aspx
<telerik:RadCloudUpload
ID="CU"
runat="server"
MultipleFileSelection="Disabled"
ProviderType="Azure"
MaxFileSize="2147483648"
OnFileUploaded="CU_FileUploaded"
OnClientUploadFailed="OnClientUploadFailed"
AllowedFileExtensions=".pdf"
httpHandlerUrl="~/AzureUploadHandler.ashx">
</telerik:RadCloudUpload>
aspx.cs
protected async void AU_FileUploaded( object sender, Telerik.Web.UI.FileUploadedEventArgs e ) {
DateTime startDate = DateTime.Now;
Bll.BfxFiles.SaveFileAsync( Sys.Config.DomainId, 0, 1, e.File.InputStream, e.File.FileName );
AsyncUploadLabel.ForeColor = System.Drawing.Color.Green;
AsyncUploadLabel.Text = string.Format( "File '{0}' uploaded successfully to Azure BLOB storage.<br/>Start: {1}<br/>End: {2}<br/>Size: {3}",
e.File.FileName, startDate.ToString(), DateTime.Now.ToString(), e.File.ContentLength.ToString() );
}
handler
<%@ WebHandler Language="C#" Class="AzureUploadHandler" %>
using System;
using System.Web;
public class AzureUploadHandler : Telerik.Web.UI.CloudUploadHandler, System.Web.SessionState.IReadOnlySessionState {
public override void SetKeyName(object sender, Telerik.Web.UI.CloudUpload.SetKeyNameEventArgs e) {
if ( HttpContext.Current.Session["SelectedBfxFileId"] == null ) {
HttpContext.Current.Response.Redirect( "~/Login.aspx?m=1" ); // session timed out
}
else {
try {
int bfxFileId = Convert.ToInt32( HttpContext.Current.Session["SelectedBfxFileId"] );
if ( bfxFileId == 0 ) {
HttpContext.Current.Response.Redirect( "~/Error.aspx?e=1" ); // invalid bfxFileId
}
else {
e.KeyName = Bll.BfxFiles.BuildBlobName( bfxFileId, e.OriginalFileName );
}
}
catch ( Exception ex ) {
throw ex;
}
}
}
}