public static XElement UploadDocument(IMediaFile media) { var data = IssuuApi.NewQuery("issuu.document.upload"); data.Add("name", media.GetName()); data.Add("title", media.Title); IssuuApi.Sign(data); var document = GetDocument(WebRequestFacade.UploadFileEx("http://upload.issuu.com/1_0", media.GetReadStream(), media.GetOrgName(), "file", data)); document.SetAttributeValue("publishing", "true"); return document; }
public static XElement DeleteDocument(IMediaFile media) { ServicePoint servicePoint = ServicePointManager.FindServicePoint(new Uri("http://api.issuu.com/1_0")); servicePoint.Expect100Continue = false; var data = IssuuApi.NewQuery("issuu.document.delete"); data.Add("names", media.GetName()); IssuuApi.Sign(data); var client = new System.Net.WebClient(); byte[] responseArray = client.UploadValues("http://api.issuu.com/1_0", data); return GetDocument(Encoding.ASCII.GetString(responseArray)); }
public static XElement UploadDocument(IMediaFile media) { var data = IssuuApi.NewQuery("issuu.document.upload"); data.Add("name", media.GetName()); data.Add("title", media.Title); IssuuApi.Sign(data); var document = GetDocument(WebRequestFacade.UploadFileEx("http://upload.issuu.com/1_0", media.GetReadStream(), media.GetOrgName(), "file", data)); document.SetAttributeValue("publishing", "true"); return(document); }
public static XElement DeleteDocument(IMediaFile media) { ServicePoint servicePoint = ServicePointManager.FindServicePoint(new Uri("http://api.issuu.com/1_0")); servicePoint.Expect100Continue = false; var data = IssuuApi.NewQuery("issuu.document.delete"); data.Add("names", media.GetName()); IssuuApi.Sign(data); var client = new System.Net.WebClient(); byte[] responseArray = client.UploadValues("http://api.issuu.com/1_0", data); return(GetDocument(Encoding.ASCII.GetString(responseArray))); }
public static string GetOrgName(this IMediaFile media) { return(string.Format("{0}.pdf", media.GetName())); }