Exemple #1
0
        public async Task <FileUploadResponse> UploadFileAsync(string url, FileBytesItem fileItem, IDictionary <string, string> headers = null, IDictionary <string, string> parameters = null)
        {
            tag = fileItem.Name;

            partBoundary = "---------------------------" + DateTime.Now.Ticks.ToString("x");


            await SaveToFileSystemAsync(new UploadFileItemInfo[] { new UploadFileItemInfo(fileItem.Bytes, fileItem.FieldName, fileItem.Name) }, parameters);

            return(await MakeRequest(url, headers));
        }
Exemple #2
0
        public async Task <FileUploadResponse> UploadFileAsync(string url, FileBytesItem fileItem, IDictionary <string, string> headers = null, IDictionary <string, string> parameters = null, string boundary = null)
        {
            if (string.IsNullOrEmpty(boundary))
            {
                boundary = "---------------------------" + DateTime.Now.Ticks.ToString("x");
            }


            var mPath = await SaveToFileSystemAsync(new UploadFileItemInfo[] { new UploadFileItemInfo(fileItem.Bytes, fileItem.FieldName, fileItem.Name) }, parameters, boundary);

            return(await MakeRequest(mPath, fileItem.Name, url, headers, boundary));
        }
 public async Task <FileUploadResponse> UploadFileAsync(string url, FileBytesItem fileItem, IDictionary <string, string> headers = null, IDictionary <string, string> parameters = null, string boundary = null)
 {
     return(await UploadFileAsync(url, new FileBytesItem[] { fileItem }, fileItem.Name, headers, parameters, boundary));
 }
Exemple #4
0
 public Task <FileUploadResponse> UploadFileAsync(string url, FileBytesItem fileItem, IDictionary <string, string> headers = null, IDictionary <string, string> parameters = null)
 {
     throw new NotImplementedException();
 }