I think you need a blank line after the content type. Here is how I did it with earlier mapscript > print "Content-type: image/jpeg" > print > output = open(drgimagefilename, 'rb').read() > print output That extra print statement after the printing of the content type ends the header block. Howard