コード例 #1
0
 public void Write(UploadInfo data)
 {
     mFileStream.Write(Convert.FromBase64String(data.Data));
     mFileStream.Flush();
     if (data.Eof)
     {
         mFileStream.Close();
     }
 }
コード例 #2
0
        public void UploadFile(string folder, UploadInfo info, IHttpContext context)
        {
            if (string.IsNullOrEmpty(folder))
            {
                folder = System.IO.Path.DirectorySeparatorChar.ToString();
            }
            UploadManager manager = (UploadManager)context.Session[FILE_UPLOAE_MANAGER];

            if (manager == null)
            {
                manager = new UploadManager();
                context.Session[FILE_UPLOAE_MANAGER] = manager;
            }
            string       filename = mPath + folder + info.Name;
            UploadWriter uw       = manager.GetWriter(filename);

            uw.Write(info);
            if (info.Eof)
            {
                manager.CloseWriter(filename);
            }
        }