Esempio n. 1
0
 public static HttpPostParameter CreateFile(string name, 
                                            string fileName, 
                                            string filePath, 
                                            string contentType,
                                            string contentDisposition)
 {
     var parameter = new HttpPostParameter(name, string.Empty)
                         {
                             Type = HttpPostParameterType.File,
                             FileName = fileName,
                             FilePath = filePath,
                             ContentType = contentType,
                             ContentDisposition = contentDisposition
                         };
     return parameter;
 }
        public static HttpPostParameter CreateFile(string name,
                                                   string fileName,
                                                   Stream fileStream,
                                                   string contentType,
                                                   string contentDisposition)
        {
            var parameter = new HttpPostParameter(name, string.Empty)
            {
                Type               = HttpPostParameterType.File,
                FileName           = fileName,
                FileStream         = fileStream,
                ContentType        = contentType,
                ContentDisposition = contentDisposition
            };

            return(parameter);
        }
Esempio n. 3
0
 public virtual void AddField(string name, string value)
 {
     var field = new HttpPostParameter(name, value);
     PostParameters.Add(field);
 }