Open lucaswhob opened 4 years ago
Please Hep Me My Friends . Thx . I Am Waiting For Help You .
discontinued???
This library is not discontinued, but maintained by volunteers that might not be able to fix your issues within 24h on a weekend.
ok . thank you . Understand My Problem ?
That code isn't going to work because you are setting title\description on a local object and not sending it to WP. However, I can't get Update to work for the same scenario:
MediaItem mediaItem = await client.Media.Create(file.FullName, file.Name);
mediaItem.Description = new Description { Raw = file.Name };
mediaItem.Title = new Title { Raw = file.Name };
mediaItem.Caption = new Caption { Raw = file.Name };
await client.Media.Update(mediaItem);
The last line throws an exception:
WPUnexpectedException: Server returned HTTP status NotAcceptable An appropriate representation of the requested resource could not be found on this server. This error was generated by Mod_Security.
This worked fine for me:
var path = Directory.GetCurrentDirectory() + "/Assets/cat.jpg";
Stream s = File.OpenRead(path);
var mediaItem = await _clientAuth.Media.Create(s, "cat.jpg");
mediaItem.Description = new Description { Raw = "Cat Description" };
mediaItem.Title = new Title { Raw = "Cat Title" };
mediaItem.Caption = new Caption { Raw = "Cat Caption" };
var updatedItem = await _clientAuth.Media.Update(mediaItem);
Assert.AreEqual(mediaItem.Title.Raw, updatedItem.Title.Raw);
Hello My Friends I Use Your Library Latest Version I Use MediaItem Upload Image Is Ok And Very Good But Property Of MediaItem SuchAs : Alt,Description,Title After Upload I Go To Wordpress Doshboard And Media Menu Image Is Uploaded Ok But Alt and Description and Title is Empty Screen Shot Of My Code MyCodeScreenShot