private async Task <HttpResponseMessage> UploadImage(string id, string type, FileUploadEntry fileToUpload) { MultipartFormDataContent content = new MultipartFormDataContent(); var fileContent = new StreamContent(fileToUpload.StreamData); fileContent.Headers.ContentDisposition = new ContentDispositionHeaderValue("form-data") { Name = "\"files\"", FileName = "\"" + fileToUpload.Name + "\"" }; fileContent.Headers.ContentType = new MediaTypeHeaderValue(fileToUpload.Type); content.Add(fileContent); return(await Http.PostAsync($"UploadImage?id={id}&type={type}", content).ConfigureAwait(false)); }
public async Task <HttpResponseMessage> UploadCommunityImage(string id, FileUploadEntry fileToUpload) { return(await UploadImage(id, "COMMUNITY", fileToUpload).ConfigureAwait(false)); }
public async Task <HttpResponseMessage> UploadEventImage(string id, FileUploadEntry fileToUpload) { return(await UploadImage(id, "EVENT", fileToUpload).ConfigureAwait(false)); }