Return an image to the browser in python, cgi-bin

前端 未结 2 1008
予麋鹿
予麋鹿 2020-12-11 08:23

I\'m trying to set up a python script in cgi-bin that simply returns a header with content-type: image/png and returns the image. I\'ve tried opening the image and returnin

2条回答
  •  野趣味
    野趣味 (楼主)
    2020-12-11 09:11

    Are you including the blank line after the header? If not, it's not the end of your headers!

    print 'Content-type: image/png'
    print
    print f.read()

提交回复
热议问题