public override UploadResult Upload(Stream stream, string fileName) { if (Uploader == null || string.IsNullOrEmpty(Uploader.UploadURL)){ Errors.Add("Default Pomf uploader automatically set to \"pomf.cat\". If you'd like to change the Pomf uploader, please select one of Pomf uploaders from \"Destination settings window -> Pomf tab\"."); Uploader = Uploaders.get(10); } UploadResult result = UploadData(stream, Uploader.UploadURL, fileName, "files[]"); if (result.IsSuccess) { PomfResponse response = JsonConvert.DeserializeObject<PomfResponse>(result.Response); if (response.success && response.files != null && response.files.Count > 0) { string url = response.files[0].url; if (!string.IsNullOrEmpty(Uploader.ResultURL)) { url = URLHelpers.CombineURL(Uploader.ResultURL, url); } result.URL = url; } } return result; }
public Pomf(PomfUploader uploader) { Uploader = uploader; }