internal static ContentDispositionInfo GetContentDisposition(string value)
        {
            if (string.IsNullOrEmpty(value))
            {
                return(null);
            }

            Match m = _getContentDisposition.Match(value);

            if (!m.Success)
            {
                return(null);
            }

            string val = m.Value;

            ContentDispositionInfo cdi = new ContentDispositionInfo();

            m = _getContentDispositionName.Match(val);
            if (m.Success)
            {
                cdi.name = m.Value;
            }


            m = _getContentDispositionFileName.Match(val);
            if (m.Success)
            {
                cdi.filename = GetFileName(m.Value);
            }

            return(cdi);
        }
        void boundaryInfoWaiter_MeetGuard(object sender, EventArgs e)
        {
            EntityBodyChunkStateWaiter sw  = sender as EntityBodyChunkStateWaiter;
            ContentDispositionInfo     cdi = UploadProgressUtils.GetContentDisposition(sw.Value);

            sw.Reset();
            if (!cdi.IsFile)
            {
                _lastCdName = cdi.name;
                _current    = _formValueWaiter;
                _current.Wait(sw);
            }
            else
            {
                statistic.BeginFileUpload(cdi.filename);
                _current = _boundaryWaiter;
                _current.Wait(sw);
            }
        }