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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T00:29:17+00:00 2026-06-11T00:29:17+00:00

I am trying to upload an image on imgur by accessing their API through

  • 0

I am trying to upload an image on imgur by accessing their API through CURL. I tried:

curl -d "image=reddit.png" -d "key=myapikey" http://api.imgur.com/2/upload.json

It raised a famous error:

{"error":{"message":"Image format not supported, or image is corrupt.","request":"\/\/2\/upload.json","method":"post","format":"json","parameters":"image = reddit.png, key = myapikey"}}

I am also facing the same issue while writing a simple bash script

#!/bin/bash 

API_KEY="myapikey"                                                                                                                                            
file="$1"                                                                                                                                      

output=$(curl -d "image=$file" -d "key=$API_KEY" http://api.imgur.com/2/upload.json)                                                           

echo $output 

The ouytput is the same error message as above. I tried it with jpg/png both format raised the same error.

So, any idea what am I doing wrong here.

PS: My imnage is not corrupt and I am executing the script/command from the same directory which contains the image.

  • 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-11T00:29:18+00:00Added an answer on June 11, 2026 at 12:29 am

    Try this:

    $ curl -d "image=@reddit.png" ...
    

    See the manpage of curl for details and read the description of the -d --data option.

    Edit:

    To encode an image, use the base64 utility:

    $ base64 reddit.png > reddit.base64.png
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to upload an image through my application with Facebook Graph API
I'm trying to use Javascript to upload a png to imgur . I've used
I'm trying to upload image to Amazon S3 with this Ruby code: require 'net/http/post/multipart'
I am trying to use JavaScript to upload image to imgur by this example
I'm trying to create a simple Imgur app that will upload images to their
I'm trying to upload an image to my site through a form, however it's
I want to upload an image to my friend's account/wall using Facebook Api Through
I'm trying to use the python requests lib to upload an image to Imgur
I am trying to send a GET request to the Imgur API to upload
I'm dealing with the following problem: when trying to upload an image through MultiPart

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.