I'm trying to upload same pictures to wordpres media library with this code , but i always get the error "Not Found". I have try replace WordPressSiteConfig Baseurl with the IP, but then i get error "Forbidden".
I have checked the media library folder permissions (0755 to 0777) but the problem remains.
What am I doing wrong?
using (var client = new WordPressSharp.WordPressClient(_wpConfig))
{
var featureImage = WordPressSharp.Models.Data.CreateFromUrl(imageurl);
featureImage.Name = Path.GetFileNameWithoutExtension(imageurl);
WordPressSharp.Models.UploadResult ur = client.UploadFile(featureImage);
}
I'm trying to upload same pictures to wordpres media library with this code , but i always get the error "Not Found". I have try replace WordPressSiteConfig Baseurl with the IP, but then i get error "Forbidden". I have checked the media library folder permissions (0755 to 0777) but the problem remains. What am I doing wrong?
WordPressSiteConfig _wpConfig = new WordPressSiteConfig(); _wpConfig.BaseUrl = "http://mydomain.com"; _wpConfig.BlogId = 0; _wpConfig.Username = username; _wpConfig.Password = password;
using (var client = new WordPressSharp.WordPressClient(_wpConfig)) { var featureImage = WordPressSharp.Models.Data.CreateFromUrl(imageurl); featureImage.Name = Path.GetFileNameWithoutExtension(imageurl); WordPressSharp.Models.UploadResult ur = client.UploadFile(featureImage); }
Thanks Marcos