Proyecto

General

Perfil

32 manumora
from BaseHTTPServer import BaseHTTPRequestHandler
import os

class MyHandler(BaseHTTPRequestHandler):

def do_GET(self):
try:
if self.path.endswith(".iso") or self.path.endswith(".md5"):
file = "/home/manu/Descargas/" + self.path
f = open(file)
s = os.path.getsize(file)

self.send_response(200)
self.send_header('Content-type', 'multipart/octet-stream')
self.send_header('Content-Length', s)
self.end_headers()

f.close()
return

except IOError:
pass