13

Background:

While trying to insert an image "from the web" into a post, I got the following error message:

Failed to upload image; the format is not supported

After trying and failing a couple of times (and even trying different images), it finally occurred to me that the image was fine, but the original host blocked imgur from accessing it.

I downloaded the image to my computer and uploaded it from there. The result was delicious:

Mmm... waffles!

Feature request:

The current error message can be utterly misleading.

  • If imgur makes it somehow possible to distinguish why an upload "from the web" failed, provide a different error message when the upload clearly failed due to reasons unrelated to the image format.

    For example, HTTP status codes 4xx or 5xx and the presence of certain HTTP headers such as Content-Encoding: text/* (assuming that imgur makes this information available) indicate either a bad URL or some sort of blocking.

  • If the latter is not possible, change the error message to something more generic. For example:

    Failed to upload image; either the format is not supported or the image could not be retrieved. Check the URL or try downloading the image to your computer and uploading it from there.

Related:

The feature request There should be a more descriptive error on image uploading failures is already , but it refers only to uploading images "from my computer".

3
  • Ooh. So that's what that was.
    – a cat
    Commented Apr 28, 2012 at 20:04
  • 1
    I'm fairly sure that the format is not supported is the reason Imgur sent back. If the web server is blocking the request, it may be sending an incorrect response code and having Imgur download an HTML file or something, which is not supported. (The image URL in the picture doesn't work for me.)
    – animuson StaffMod
    Commented Apr 28, 2012 at 20:07
  • @animuson: I don't remember the URL, but I found out because I tried to download the image using wget. The response was a blank page with a HTTP 401 Unauthorized header. (Spoofing the user agent did the trick.) For testing purposes: redtwitz.com/401/unauthorized.png
    – Dennis
    Commented Apr 28, 2012 at 20:24

1 Answer 1

4

I have added some more checks for image uploads with descriptive messages.

Unfortunately, when it comes to passing a URL to imgur, we can only display what they tell us (which ends up being a 400 error).

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .