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));
		}
示例#3
0
        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);
        }
示例#4
0
        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)));
        }
示例#5
0
 public static string GetOrgName(this IMediaFile media)
 {
     return(string.Format("{0}.pdf", media.GetName()));
 }