Im trying to serve a video file from my home WAMP server (windows 8) to the browser, but the browser keeps giving an error 500, and the apache logs says malformed header from script 's.py': Bad header: G@
"s.py" is my python version 3.4 script
n="\\wamp\\www\\r.mp4"
print ("Last-Modified: Fri, 24 Apr 2015 22:09:52 GMT")
print ("Accept-Ranges: bytes")
print ("Content-Length:", os.path.getsize(n))
print ("Content-type: video/mp4\r\n\r\n")
f=open(n, 'rb')
d=f.read()
sys.stdout.buffer.write(d)
sys.stdout.flush()
f.close()
i can run other simple python scripts on the server using the browser, so i know thats working, but for some reason it wont serve this mp4 file.
in the browser i call it using the URL "localhost/s.py", then it just gives error 500, and server log shows malformed header.
I been working on it all day, anybody have any idea how to solve it,
Thanks