composer/projects/gk7205v200_lite_meldana/general/overlay/www/cgi-bin/dl.cgi

24 lines
470 B
Bash
Executable File

#!/usr/bin/haserl
<%in p/common.cgi %>
<%
file=$GET_file
if [ "/tmp/webui.log" = "$file" ]; then
fname="webui-$(date +%s).log"
mime="text/plain"
else
fname=$(basename $file)
mime="application/octet-stream"
fi
check_file_exist $file
echo "HTTP/1.0 200 OK
Date: $(time_http)
Server: $SERVER_SOFTWARE
Content-type: ${mime}
Content-Disposition: attachment; filename=${fname}
Content-Length: $(stat -c%s $file)
Cache-Control: no-store
Pragma: no-cache
"
cat $file
%>