From: Sven Schöling Date: Mon, 6 Feb 2012 19:17:11 +0000 (+0100) Subject: Multiuploadfähigkeit X-Git-Tag: release-2.7.0beta1~10^2~5 X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=34967eb43b59e701399fc831d978ec9460eb87bc;p=kivitendo-erp.git Multiuploadfähigkeit Jeder Upload ist unter seinem Requestpfad als reine Datenstruktur erreichbar, und ausserdem unter $target->{ATTACHMENT} als deskriptive Struktur mit Metainformationen. --- diff --git a/SL/Request.pm b/SL/Request.pm index dab57457a..38dfc1f23 100644 --- a/SL/Request.pm +++ b/SL/Request.pm @@ -106,11 +106,18 @@ sub _parse_multipart_formdata { $previous = _store_value($filename ? $target : $temp_target, $name, '') if ($name); $temp_target->{FILENAME} = $filename if ($filename); + # for multiple uploads: save the attachments in a SL/Mailer like structure + if ($name && $filename) { + _store_value($target, "ATTACHMENTS.$name.data", $previous); + _store_value($temp_target, "ATTACHMENTS.$name.filename", $filename); + } + next; } if ($line =~ m|^content-type\s*:\s*(.*?)[;\$]|i) { $content_type = $1; + _store_value($temp_target, "ATTACHMENTS.$name.content_type", $1); if ($content_type =~ /^text/ && $line =~ m|;\s*charset\s*:\s*("?)(.*?)\1$|i) { $encoding = $2;