Example #1
0
        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);
        }
Example #2
0
 public void RadAsyncUpload1_FileUploaded(object sender, FileUploadedEventArgs e)
 {
     SampleAsyncUploadResult result = e.UploadResult as SampleAsyncUploadResult;
 }