private string SerializeClientObject(IAsyncUploadResult fileInfo, MetaData metaData)
        {
            string str  = SerializationService.Serialize(fileInfo);
            string str2 = SerializationService.Serialize(metaData, true);

            fileInfo.FileName = Path.GetFileName(fileInfo.FileName);
            return(string.Format("{{\"fileInfo\":{0}, \"metaData\":\"{1}\" }}", str, str2));
        }
 private void ProcessUploadedFile()
 {
     if (this.ValidateSize(this.RequestData.UploadedFile.ContentLength, this.Configuration.MaxFileSize))
     {
         IAsyncUploadResult fileInfo = this.Process(this.RequestData.UploadedFile, this.Context, this.Configuration, this.TemporaryFileName);
         MetaData           metaData = new MetaData
         {
             TempFileName        = this.TemporaryFileName,
             AsyncUploadTypeName = fileInfo.GetType().AssemblyQualifiedName
         };
         this.ResponseWriter.WriteToResponse(this.SerializeClientObject(fileInfo, metaData));
     }
 }
Beispiel #3
0
 public static void CopyFileInfo(IAsyncUploadResult result, UploadedFile file)
 {
     result.ContentLength = file.ContentLength;
     result.ContentType   = file.ContentType;
     result.FileName      = Path.GetFileName(file.FileName);
 }
 public static void CopyFileInfo(IAsyncUploadResult result, UploadedFile file)
 {
     result.ContentLength = file.ContentLength;
     result.ContentType = file.ContentType;
     result.FileName = Path.GetFileName(file.FileName);
 }