0

If a URL ends with just a string of characters, and no extension. i.e.:

http://example/1234567890

...and I know contains either a PNG, JPG or GIF. How do I find out which one it is without downloading the whole file. I'm asking because I need to do something completely different with it if it's a GIF.

rmaddy
  • 314,917
  • 42
  • 532
  • 579
cannyboy
  • 24,180
  • 40
  • 146
  • 252

1 Answers1

1

Make a header request and look for the mime type as was posted here:

Get HTTP header fields only on iPhone

Complete List of MIME Types

Community
  • 1
  • 1