From 34967eb43b59e701399fc831d978ec9460eb87bc Mon Sep 17 00:00:00 2001 From: =?utf8?q?Sven=20Sch=C3=B6ling?= Date: Mon, 6 Feb 2012 20:17:11 +0100 Subject: [PATCH] =?utf8?q?Multiuploadf=C3=A4higkeit?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Jeder Upload ist unter seinem Requestpfad als reine Datenstruktur erreichbar, und ausserdem unter $target->{ATTACHMENT} als deskriptive Struktur mit Metainformationen. --- SL/Request.pm | 7 +++++++ 1 file changed, 7 insertions(+) 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; -- 2.20.1