Ejemplo n.º 1
0
        protected virtual HttpRequestItem CreateItem(IList header, HeaderFieldList fieldList)
        {
            string source = HeaderFieldList.GetHeaderFieldValue(header, fieldList, "Content-Disposition");

            if (
                !HeaderFieldList.GetHeaderFieldValueItem(source, "").ToLower(CultureInfo.InvariantCulture).Equals(
                    "form-data"))
            {
                return(Items.AddTextData(""));
            }
            string headerFieldValueItem = HeaderFieldList.GetHeaderFieldValueItem(source, "filename=");

            if (!StringUtils.IsEmpty(headerFieldValueItem))
            {
                return(Items.AddSubmitFile(headerFieldValueItem, ""));
            }
            return(Items.AddFormField(HeaderFieldList.GetHeaderFieldValueItem(source, "name="), string.Empty));
        }