X-Git-Url: https://git.plutz.net/?a=blobdiff_plain;f=cards%2Fexport_card.sh;h=0918032c6019fc8da3d3be9a0711b539fdb01365;hb=refs%2Fheads%2Fcgilite;hp=def0b2dbbf6f06ba03b5832a39f1674304e5c6cb;hpb=ddb4d16fb5108aa0af5e53322974b0c0f26ac408;p=lobster diff --git a/cards/export_card.sh b/cards/export_card.sh index def0b2d..0918032 100755 --- a/cards/export_card.sh +++ b/cards/export_card.sh @@ -1,6 +1,6 @@ -#!/bin/zsh +#!/bin/sh -# Copyright 2014,2015 Paul Hänsch +# Copyright 2014, 2015, 2021 Paul Hänsch # # This file is part of Confetti. # @@ -20,9 +20,9 @@ card="$(GET card |PATH)" cardfile="$_DATA/vcard/${card##*/}" -if [ -f "$cardfile" ]; then - . $_EXEC/cgilite/file.sh - FILE "$cardfile" "text/vcard/charset=utf-8" -else - printf 'Status: 404 Not Found\r\nContent-Length: 0\r\n\r\n' -fi +. $_EXEC/pdiread.sh +. $_EXEC/cgilite/file.sh + +printf 'Content-Disposition: inline; filename="%s.vcf"\r\n' "$(pdi_value "$(pdi_load "$cardfile")" FN)" + +FILE "$cardfile" "text/vcard; charset=utf-8"