]> git.plutz.net Git - shellwiki/blobdiff - attachment.sh
handling of binary file uploads
[shellwiki] / attachment.sh
index 68e03b9b7ab9435961ca41abbaa93e2667aced7d..d004b0db549954f00575810169f6a6665c9357e3 100755 (executable)
@@ -60,7 +60,17 @@ attachment_convert(){
   esac
 }
 
-if [ "${PATH_INFO%/\[attachment\]/*}" != "${PATH_INFO}" ]; then
+if [ "${PATH_INFO%/\[attachment\]/}"  != "${PATH_INFO}" ]; then
+  . "$_EXEC/multipart.sh"
+  if multipart_cache; then
+    debug 'Multipart "file":'
+    multipart file |hd |debug >/dev/null
+    REDIRECT "${_BASE}${PATH_INFO}"
+  else
+    theme_attachments "${PATH_INFO%\[attachment\]/}"
+  fi
+
+elif [ "${PATH_INFO%/\[attachment\]/*}" != "${PATH_INFO}" ]; then
   attpath="${PATH_INFO%/\[attachment\]/*}/#attachments/${PATH_INFO##*/}"
   if [ -f "$_DATA/pages/$attpath" ]; then
     FILE "$_DATA/pages/$attpath"