corrupted GIF through CGI

Skip Montanaro skip at pobox.com
Tue May 6 21:06:05 EDT 2003


    Seung> This is on apache 1.3 python 2.2 (straight up cgi) on a windows
    Seung> machine

    Seung> The following is the code I have

    Seung> #!d:\progra~1\python22\python.exe
    Seung> buf = (open("generic.gif", "rb")).read()

    Seung> print """Content-Type: image/gif
    Seung> Content-Length: %d
    Seung> """%(len(buf))
    Seung> print buf

Look here:

    http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/65443

Should get you started.

Skip





More information about the Python-list mailing list