--- /dev/null
+#!/bin/sh
+# Copyright (c) 2023 Jakub Czajka <jakub@ekhem.eu.org>
+# License: GPL-3.0 or later.
+
+. /etc/environment
+
+# Replace %2F with '/' and remove %0D%0A.
+NAME=$(echo ${NAME_ON_DRIVE} | sed 's/%2F/\//g; s/%0D%0A//g')
+
+echo "HTTP/1.1 200 OK"
+echo "Content-Type: text/html"
+echo "
+<!DOCTYPE html>
+<html>
+<head>
+ <meta http-equiv='Refresh' content='0;URL=/$(basename ${NAME})' />
+ <style>
+ body {
+ white-space: pre-wrap;
+ }
+ </style>
+</head>
+<body>"
+echo "Downloading ${NAME}"
+python3 -u -m gdrive_knife 2>&1 download --token ${gdrive_auth_token} \
+ --key ${gdrive_encryption_key} --leave-as-archive ${NAME} /tmp
+echo "\
+</body>
+</html>"