The format specification is a mime-type, not a graphic format, hence image/jpeg wou ld be the proper format and not JPEG. We'll also have to take care of the encoding of / as %2F.