protected override IAsyncUploadResult Process(UploadedFile file, HttpContext context, IAsyncUploadConfiguration configuration, string tempFileName) { telerikAsyncUploadResult result = CreateDefaultUploadResult<telerikAsyncUploadResult>(file); string folderType = "temp"; DocAccess objDoc = new DocAccess(); result.DocumentID = 0; result.DocumentID = objDoc.saveFiles(file, folderType, Convert.ToInt32(context.Session["ClientID"]), Convert.ToInt32(context.Session["UserID"]), 0, Convert.ToInt32(context.Session["WebinarID"])); return result; }
public override object Deserialize(IDictionary <string, object> dictionary, Type type, JavaScriptSerializer serializer) { IDictionary <string, object> dictionary2 = dictionary["TimeToLive"] as IDictionary <string, object>; IAsyncUploadConfiguration config = Activator.CreateInstance(type) as IAsyncUploadConfiguration; long num = Convert.ToInt64(dictionary2["Ticks"]); config.TimeToLive = TimeSpan.FromTicks(num); object obj2 = typeof(JavaScriptSerializer).GetMethod("ConvertToType", new Type[] { typeof(object) }, null).MakeGenericMethod(new Type[] { type }).Invoke(new JavaScriptSerializer(), new object[] { dictionary }); return(this.MergeDefaultConfiguration(config, (IAsyncUploadConfiguration)obj2)); }
internal IAsyncUploadConfiguration GetConfiguration(string rawData) { string[] strArray = rawData.Split(new char[] { '&' }); string str = strArray[0]; Type type = Type.GetType(CryptoService.Decrypt(strArray[1])); IAsyncUploadConfiguration configuration = (IAsyncUploadConfiguration)SerializationService.Deserialize(str, type, true); configuration.TargetFolder = DecryptFolder(configuration.TargetFolder); configuration.TempTargetFolder = DecryptFolder(configuration.TempTargetFolder); return(configuration); }
protected override IAsyncUploadResult Process(UploadedFile file, HttpContext context, IAsyncUploadConfiguration configuration, string tempFileName) { // Call the base Process method to save the file to the temporary folder //base.Process(file, context, configuration, tempFileName); // Populate the default (base) result into an object of type telerikAsyncUploadResult telerikAsyncUploadResult result = CreateDefaultUploadResult<telerikAsyncUploadResult>(file); int userID = -1; int clientID = -1; string folderType = string.Empty; DocAccess objDoc = new DocAccess(); //Follwoing is commented as the custom config values are not getting passed. //telerikUploadConfig getConfig = configuration as telerikUploadConfig; //if (getConfig != null) //{ // userID = getConfig.ActionID; // clientID = getConfig.ClientID; // folderType = getConfig.FolderType; // result.DocumentID = objDoc.saveFiles(file, folderType, clientID, userID); //} result.DocumentID = 0; if (context.Request["uid"] != null) userID = 1; string refURL = context.Request.UrlReferrer.ToString().ToUpper(); if (refURL.IndexOf("BIO") > 0) folderType = "PROFILE"; if (refURL.IndexOf("AUDIFEATURE_CONTENT") > 0) folderType = "PRESENTATION"; if (refURL.IndexOf("SNAPSITE") > 0) folderType = "SS"; if (folderType == string.Empty) { if (context.Request["ftyp"] != null) { if (Convert.ToString(context.Request["ftyp"]) == "u") folderType = "PROFILE"; else folderType = "PRESENTATION"; } else if (context.Session["FolderType"] != null) folderType = Convert.ToString(context.Session["FolderType"]); } if (folderType != string.Empty) { if (userID == -1) result.DocumentID = objDoc.saveFiles(file, folderType, Convert.ToInt32(context.Session["ClientID"]), Convert.ToInt32(context.Session["UserID"]), 0, Convert.ToInt32(context.Session["WebinarID"])); else result.DocumentID = objDoc.saveFiles(file, folderType, Convert.ToInt32(context.Session["ClientID"]), Convert.ToInt32(context.Session["UserID"]), Convert.ToInt32(context.Session["UserID"]), 0); //if (folderType != "PRESENTATION") //{ // DocAccess objDocAccess = new DocAccess(); // objDocAccess.resizeImage(result.DocumentID, Convert.ToInt32(context.Session["ClientID"])); //} } return result; }
private object MergeDefaultConfiguration(IAsyncUploadConfiguration config, IAsyncUploadConfiguration customObject) { customObject.TimeToLive = config.TimeToLive; return customObject; }
private object MergeDefaultConfiguration(IAsyncUploadConfiguration config, IAsyncUploadConfiguration customObject) { customObject.TimeToLive = config.TimeToLive; return(customObject); }
protected void SaveToTempFolder(UploadedFile file, IAsyncUploadConfiguration config, HttpContext context, string tempFileName) { this.AddCacheDependency(context, tempFileName, config.TimeToLive, this.FullPath); file.SaveAs(this.FullPath, false); }
protected internal virtual IAsyncUploadResult Process(UploadedFile file, HttpContext context, IAsyncUploadConfiguration configuration, string tempFileName) { this.SaveToTempFolder(file, configuration, context, tempFileName); return(this.CreateDefaultUploadResult <UploadedFileInfo>(file)); }
protected override IAsyncUploadResult Process(UploadedFile file, HttpContext context, IAsyncUploadConfiguration configuration, string tempFileName) { // Call the base Process method to save the file to the temporary folder // base.Process(file, context, configuration, tempFileName); // Populate the default (base) result into an object of type SampleAsyncUploadResult SampleAsyncUploadResult result = CreateDefaultUploadResult <SampleAsyncUploadResult>(file); string userID = string.Empty; // You can obtain any custom information passed from the page via casting the configuration parameter to your custom class SampleAsyncUploadConfiguration sampleConfiguration = configuration as SampleAsyncUploadConfiguration; if (sampleConfiguration != null) { userID = sampleConfiguration.UserID; } // Populate any additional fields into the upload result. // The upload result is available both on the client and on the server result.ImageID = InsertImage(file, userID); return(result); }