11

I am attempting to upload the following image "from the web" into a post:

URL: http://res2.windows.microsoft.com/resbox/en/windows%207/main/4f6cbd09-148c-4dd8-b1f2-48f232a2fd33_818.jpg

When I do this, the dialog states "Failed to upload image; the format is not supported".

enter image description here

I have been able to narrow it down, thanks to Mhmd's comment below, to URLs that contain (at least) spaces (I tested on my own server with a file named "astro%20naut.jpg", after URL encoding, although I cannot share the URL).

If I upload direct to imgur from such a URL, there is no problem. It appears to be some issue on the SE side of things.

11
  • You could try upoading it to imgur directly, maybe that gives a more detailed error message Aug 6, 2014 at 17:08
  • 3
    If I save this on my computer and upload it from there, it works fine, while it doesn't when adding it from the web.
    – ProgramFOX
    Aug 6, 2014 at 17:11
  • @MadScientist It uploads just fine direct to imgur.
    – Jason C
    Aug 6, 2014 at 19:24
  • 2
    It is not about the extension, it is about the url itself since it contains letters that are not supported.
    – Mohammad
    Aug 6, 2014 at 19:32
  • @Mhmd Good call; I tested and was able to consistently reproduce with URLs with a space in the URL. I've updated the post to reflect this.
    – Jason C
    Aug 6, 2014 at 19:55
  • I guess the URL is being decoded somewhere when using the API (probably on SE side) so when it reach imgur, it's not pointing on the correct place anymore. Aug 6, 2014 at 22:13
  • 1
    I've tried to replace the %20 by a space, same error. Then I tried to use TinyURL to change the URL, same error again.
    – A.L
    Aug 7, 2014 at 4:08
  • @A.L Replacing with a space is no surprise (I also observed the same thing), but the TinyURL thing is a surprise. I wonder why that could be? Must mean the problem is somehow after any redirects are handled.
    – Jason C
    Aug 7, 2014 at 4:09
  • @Jason C TinyURL is just a redirection to the file, it seems that this doesn't prevent the problem.
    – A.L
    Aug 7, 2014 at 4:10
  • The format is not supported can concern the URL or the image itself, for example if the Microsoft website doesn't return the right MIME type.
    – A.L
    Aug 7, 2014 at 4:12
  • 1
    @A.L That's a good point. In this case, I did test with my own publicly visible web server, and a few different images, all JPEG, all with correctly reported MIME type of image/jpeg, with the same results. The error here in this case is dependent entirely on %20 or a space in the URL, not on any other factors.
    – Jason C
    Aug 7, 2014 at 4:22

1 Answer 1

5

I encountered this problem too and made some tests to see what may be causing it. My guess is that it's probably a bug with the function doing the URL validation: If there is even a single character after %20, the URL would be rejected.

Trying to mask the invalid URL using a URL shortener that does 301 redirect (e.g. http://goo.gl/Yvkhd5 and http://bit.ly/1pTlrMs) does not work too.

Urls tested to work:

Urls tested to not work:

You must log in to answer this question.

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