/// <summary>
        /// Prepare a Multipart Parser with a specific encoding, specifying the file handling
        /// </summary>
        /// <param name="stream">The HTTP multipart request body</param>
        /// <param name="encoding">The encoding to use when parsing</param>
        /// <param name="type">How the parser should handle files</param>
        public HTTPMultipartParser(Stream stream, Encoding encoding, EFileHandlingType type)
        {
            this.stream    = stream;
            this.encoding  = encoding;
            this.parseType = type;
            this.Fields    = new Dictionary <string, MultipartData>();

            CRbytes     = encoding.GetBytes("\r");
            LFbytes     = encoding.GetBytes("\n");
            CRLFbytes   = encoding.GetBytes("\r\n");
            finishBytes = encoding.GetBytes("--");
        }
 /// <summary>
 /// Prepare a Multipart Parser and specify the file handling type
 /// </summary>
 /// <param name="stream">The HTTP multipart request body</param>
 /// <param name="type">How the parser should handle files</param>
 public HTTPMultipartParser(Stream stream, EFileHandlingType type)
 {
     this.stream    = stream;
     this.parseType = type;
     this.Fields    = new Dictionary <string, MultipartData>();
 }
Esempio n. 3
0
        /// <summary>
        /// Prepare a Multipart Parser with a specific encoding, specifying the file handling
        /// </summary>
        /// <param name="stream">The HTTP multipart request body</param>
        /// <param name="encoding">The encoding to use when parsing</param>
        /// <param name="type">How the parser should handle files</param>
        public HTTPMultipartParser(Stream stream, Encoding encoding, EFileHandlingType type)
        {
            this.stream = stream;
            this.encoding = encoding;
            parseType = type;
            Fields = new Dictionary<string, MultipartData>();

            CRbytes = encoding.GetBytes("\r");
            LFbytes = encoding.GetBytes("\n");
            CRLFbytes = encoding.GetBytes("\r\n");
            finishBytes = encoding.GetBytes("--");
        }
Esempio n. 4
0
 /// <summary>
 /// Prepare a Multipart Parser and specify the file handling type
 /// </summary>
 /// <param name="stream">The HTTP multipart request body</param>
 /// <param name="type">How the parser should handle files</param>
 public HTTPMultipartParser(Stream stream, EFileHandlingType type)
 {
     this.stream = stream;
     parseType = type;
     Fields = new Dictionary<string, MultipartData>();
 }