def METHOD_NAME(self):
    path = self.translate_path(self.path)
    os.makedirs(os.path.dirname(path), exist_ok=True)
    try:
        self._handle_auth()
        file_length = int(self.headers["Content-Length"])
        with open(path, "wb") as output_file:
            output_file.write(self.rfile.read(file_length))
        self.send_response(HTTPStatus.CREATED)
        self.send_header("Content-Length", "0")
        self.end_headers()
    except AuthenticationError:
        self.send_error(HTTPStatus.UNAUTHORIZED, "Need Authentication")
    except OSError:
        self.send_error(
            HTTPStatus.INTERNAL_SERVER_ERROR, "Cannot open file for writing"
        )