Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error when uploading images #333

Open
mirasolutions opened this issue Nov 24, 2022 · 2 comments
Open

Error when uploading images #333

mirasolutions opened this issue Nov 24, 2022 · 2 comments

Comments

@mirasolutions
Copy link

Hello
i have this error when upload images

Error converting value "" to type 'WordPressPCL.Models.OpenStatus'. Path 'comment_status', line 1, position 465

any idea ?

@ThomasPe
Copy link
Member

ThomasPe commented Dec 21, 2022

hey, does the image get uploaded or does this error happen before the actual upload? can you show some code?

@mirasolutions
Copy link
Author

Yes, upload work but not return URL of image

private async Task carica_foto(WordPressClient wpc)
{
Stream s = File.OpenRead(this.path_foto);
bool valid = await wpc.IsValidJWToken();
MediaItem createdMedia = null;
if (valid) {
createdMedia = await wpc.Media.Create(s, this.nome_foto);
}
return createdMedia.SourceUrl;
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants