Пример #1
0
        /// <summary>
        /// 在请求中添加要上传的文件
        /// </summary>
        /// <param name="data">要上传的文件内容</param>
        /// <param name="fileName">文件名</param>
        /// <param name="fieldName">文件字段的名称(相当于&lt;input type=file Name=fieldName&gt;)里的fieldName)</param>
        /// <param name="contentType"></param>
        public void AttachFile(byte[] data, string fileName, string fieldName, string contentType)
        {
            HttpUploadingFile file = new HttpUploadingFile(data, fileName, fieldName, contentType);

            _files.Add(file);
        }
Пример #2
0
        /// <summary>
        /// 在请求中添加要上传的文件
        /// </summary>
        /// <param name="fileName">要上传的文件路径</param>
        /// <param name="fieldName">文件字段的名称(相当于&lt;input type=file Name=fieldName&gt;)里的fieldName)</param>
        public void AttachFile(string fileName, string fieldName)
        {
            HttpUploadingFile file = new HttpUploadingFile(fileName, fieldName);

            _files.Add(file);
        }