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 8322583
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T23:26:17+00:00 2026-06-08T23:26:17+00:00

I wanna upload an image to Imgur.com using it’s API as an annonymouse user.

  • 0

I wanna upload an image to Imgur.com using it’s API as an annonymouse user. After i upload the image, i wanna get that image url dynamically. How can i achieve this using C# Winforms?

  • 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-08T23:26:18+00:00Added an answer on June 8, 2026 at 11:26 pm

    The documentation provides an example that you could try:

    using System;
    using System.IO;
    using System.Net;
    using System.Text;
    
    namespace ImgurExample
    {
        class Program
        {
            static void Main(string[] args)
            {
                PostToImgur(@"C:\Users\ashwin\Desktop\image.jpg", IMGUR_ANONYMOUS_API_KEY);
            }
    
            public static void PostToImgur(string imagFilePath, string apiKey)
            {
                byte[] imageData;
    
                FileStream fileStream = File.OpenRead(imagFilePath);
                imageData = new byte[fileStream.Length];
                fileStream.Read(imageData, 0, imageData.Length);
                fileStream.Close();
    
                const int MAX_URI_LENGTH = 32766;
                string base64img = System.Convert.ToBase64String(imageData);
                StringBuilder sb = new StringBuilder();
    
                for(int i = 0; i < base64img.Length; i += MAX_URI_LENGTH) {
                    sb.Append(Uri.EscapeDataString(base64img.Substring(i, Math.Min(MAX_URI_LENGTH, base64img.Length - i))));
                }
    
                string uploadRequestString = "image=" + sb.ToString() + "&key=" + imgurApiKey;
    
                HttpWebRequest webRequest = (HttpWebRequest)WebRequest.Create("http://api.imgur.com/2/upload");
                webRequest.Method = "POST";
                webRequest.ContentType = "application/x-www-form-urlencoded";
                webRequest.ServicePoint.Expect100Continue = false;
    
                StreamWriter streamWriter = new StreamWriter(webRequest.GetRequestStream());
                streamWriter.Write(uploadRequestString);
                streamWriter.Close();
    
                WebResponse response = webRequest.GetResponse();
                Stream responseStream = response.GetResponseStream();
                StreamReader responseReader = new StreamReader(responseStream);
    
                string responseString = responseReader.ReadToEnd();
            }
        }
    }
    

    The response returned by the server will contain the link to the uploaded image. For example:

    {
        "upload": {
            "image": {
                "name": false,
                "title": "",
                "caption": "",
                "hash": "cSNjk",
                "deletehash": "ZnKGru1reZKoabU",
                "datetime": "2010-08-16 22:43:22",
                "type": "image\/jpeg",
                "animated": "false",
                "width": 720,
                "height": 540,
                "size": 46174,
                "views": 0,
                "bandwidth": 0
            },
            "links": {
                "original": "http:\/\/imgur.com\/cSNjk.jpg",
                "imgur_page": "http:\/\/imgur.com\/cSNjk",
                "delete_page": "http:\/\/imgur.com\/delete\/ZnKGru1reZKoabU",
                "small_square": "http:\/\/imgur.com\/cSNjks.jpg",
                "large_thumbnail": "http:\/\/imgur.com\/cSNjkl.jpg"
            }
        }
    }
    

    In order to use the anonymous API you will need to obtain an API key.

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

Sidebar

Related Questions

i wanna make really sure, that a user can upload large files to my
I wanna upload/update file by System.IO.FileStream in Google Documents List API(C#)? I use two
I wanna get the Timedate value from another page using request.querystring and then use
Just wanna ask what is the code to upload image to database is it
I'm thinking about a plugin that can upload whatever user see in his page,
i have a proyect that im trying to finish i wanna upload images i
I have a form and there I wanna allow to user upload only one
I will make upload my application today to my homepage and wanna to have
I wanna check sharepoint title first and see if the lib doesn't have that
I wanna get the string representation of a variable. For example, (def my-var {})

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.