public string PostBlog(string SiteId, string WPUserId, string Message, string Tittle,string tags, string UserId, byte[] imagebytes)
 {
     //string file = string.Empty;
     //MemoryStream stream = new MemoryStream(image);
     //Image img = Image.FromStream(stream);
     //FileStream fs= stream as FileStream;
     //string filename = fs.Name;
     //string type = img.RawFormat.GetType().ToString();
     //var path = Server.MapPath("~/" + System.Configuration.ConfigurationManager.AppSettings["domain"] + "/Contents/img/upload");
     //string imageid=Guid.NewGuid().ToString();
     //file = path + "\\" + SiteId + "_" + WPUserId + "_" + imageid + ".png";
     //if (!Directory.Exists(path))
     //{
     //    Directory.CreateDirectory(path);
     //}
    
     //File.WriteAllBytes(file,image);
     string encodedimg = string.Empty;
     try
     {
         encodedimg = Convert.ToBase64String(imagebytes);
     }
     catch (Exception ex)
     {
     }
     Domain.Myfashion.Domain.WordpressAccount objWordpressAccount = new Domain.Myfashion.Domain.WordpressAccount();
     objWordpressAccount = objWPAccountRepo.GetWordpressAccountById(Guid.Parse(UserId), WPUserId);
     oAuthWordpress _oAuth = new oAuthWordpress();
     try
     {
         _oAuth.access_token = objWordpressAccount.AccessToken;
         string postData = _oAuth.PostDataToPostBlog(Tittle, Message, tags, encodedimg);
         string _response = _oAuth.APIWebRequest(Globals._PostBlog.Replace("[SiteId]", SiteId), postData);
     }
     catch (Exception ex)
     {
     }
     return "Success";
 }