Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8527611
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T08:36:20+00:00 2026-06-11T08:36:20+00:00

I have literally tried every possible way on this but apparently I just can’t

  • 0

I have literally tried every possible way on this but apparently I just can’t figure out the right one.

I am trying to upload images to the next-gen gallery that is installed on a wordpress blog. Everything about xml-rpc is working since I am able to do all other stuff with it.

The problem is that server returns an error saying the image is not a valid one. Which is quite obvious that the problem is about base64. However, for test purposes i copied and checked the base64 string and realized it is just right, it converts right to the image using an external base64 to image converter.

This is the line that submits the query.

    result = categories.newImage(1, "admin", "password", newImage);

The struct for newImage is;

    public struct imageI
    {
        public string name;
        public string type;
        public string bits;
        public bool overwrite;
        public int gallery;
        public int image_id;

    }

And this is how a new one is initialized, along with converting an image into base64

        //Creating the image base64 string
        string filename = "asd.jpg";
        Image image1 = Image.FromFile(filename);
        string base64 = ImageToBase64(image1, image1.RawFormat);
        //for test purposes i copied and checked the base64 and it is just right, it converts right to the image using an external base64 to image converter.
        Clipboard.SetText(base64);

        //Creating a newImage 
        imageI newImage = default(imageI);
        newImage.name = "newImage";
        newImage.bits = base64;
        newImage.gallery= 86;

And finally my method “ImageToBase64(Image, ImageFomat)”;

    public string ImageToBase64(Image image, System.Drawing.Imaging.ImageFormat format)
    {
        using (MemoryStream ms = new MemoryStream())
        {
            // Convert Image to byte[]
            image.Save(ms, format);
            byte[] imageBytes = ms.ToArray();

            // Convert byte[] to Base64 String
            string base64String = Convert.ToBase64String(imageBytes);
            return base64String;

        }
    }
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T08:36:21+00:00Added an answer on June 11, 2026 at 8:36 am

    In case anybody bumps on this, I figured it out, on the line;
    newImage.name = "newImage"; the file name should be the same with the one you are uploading, or at least it should have the same extension so that the function in xml-rpc file can resolve the extension and check if it’s okay to upload or not.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have tried everything to solve this issue and can't get anything to work.
I have quite literally tried every combination and asked a friend for the reason
This is literally driving me nuts. I have 2 entities that use NSStrings as
Well, I know it may sounds basic, but I have literally been looking everywhere
Right I'm getting a bit tired of this so hopefully you can help me
OK, I'm new to compiling programs, and I have literally tried everything. I downloaded
In my career I have seen literally dozens of ways that people choose to
I have a rather large application that has literally a hundred DDLs with Yes
So I have custom UITableViewCells (made with storyboard), and when I do not literally
If I have a file, and I want to literally write '42' to it

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.