From ceca62d37e1c65706a2e5bc9a844912d3ea36ae2 Mon Sep 17 00:00:00 2001 From: centaurix Date: Tue, 23 Jul 2002 11:32:20 +0000 Subject: [PATCH] fixed bug #585340 git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@3124 7612ce4b-ef26-0410-bec9-ea0150e637f0 --- src/compose.php | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/compose.php b/src/compose.php index 0e24912a..83ffe5c2 100644 --- a/src/compose.php +++ b/src/compose.php @@ -899,9 +899,17 @@ function saveAttachedFiles($session) { } if (!@rename($HTTP_POST_FILES['attachfile']['tmp_name'], $full_localfilename)) { - if (!@copy($HTTP_POST_FILES['attachfile']['tmp_name'], $full_localfilename)) { + if (function_exists("move_uploaded_file")) { + if (!@move_uploaded_file($HTTP_POST_FILES['attachfile']['tmp_name'], $full_localfilename)) { return true; - } + } + } else { + + if (!@copy($HTTP_POST_FILES['attachfile']['tmp_name'], $full_localfilename)) { + return true; + } + } + } $newAttachment['localfilename'] = $localfilename; -- 2.25.1