簡體   English   中英

如何從BASH中的CGI開始下載?

[英]How to start download from CGI in BASH?

我有此CGI腳本,但是如何在瀏覽器中開始下載?

#!/bin/bash

echo "Content-Type: text/plain"
echo

CUR=$(ls -t /var/www/html/certs/*$AUTHENTICATE_UID* | head -1)

if [ "$CUR" != "" ]; then

# start download in the browser

fi

通常,您將發出Content-Disposition標頭:

echo "Content-Type: text/plain"

CUR=$(ls -t /var/www/html/certs/*$AUTHENTICATE_UID* | head -1)
if [ "$CUR" != "" ]; then
    echo 'Content-Disposition: attachment; filename="yourFile.txt"'
fi

echo  # End of headers.

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM