cookutils rev 721
cooker.cgi: fix download
author | Pascal Bellard <pascal.bellard@slitaz.org> |
---|---|
date | Fri Apr 17 14:10:59 2015 +0200 (2015-04-17) |
parents | 46fb7ee18cb7 |
children | 2cf877e5b167 |
files | web/cooker.cgi |
line diff
1.1 --- a/web/cooker.cgi Thu Apr 16 19:26:45 2015 +0200 1.2 +++ b/web/cooker.cgi Fri Apr 17 14:10:59 2015 +0200 1.3 @@ -24,14 +24,14 @@ 1.4 export TZ=$(cat /etc/TZ) 1.5 1.6 if [ "${QUERY_STRING%%=*}" == "download" ]; then 1.7 - file=$PKGS/${QUERY_STRING#*=} 1.8 + file=$(busybox httpd -d "$PKGS/${QUERY_STRING#*=}") 1.9 cat <<EOT 1.10 Content-Type: application/octet-stream 1.11 -Content-Length: $(stat -c %s $file) 1.12 -Content-Disposition: attachment; filename=$(basename $file) 1.13 +Content-Length: $(stat -c %s "$file") 1.14 +Content-Disposition: attachment; filename="$(basename "$file")" 1.15 1.16 EOT 1.17 - cat $file 1.18 + cat "$file" 1.19 exit 1.20 fi 1.21