centaurix 23 years ago
parent
commit
a8ae2e35cb
1 changed files with 10 additions and 2 deletions
  1. 10 2
      src/compose.php

+ 10 - 2
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;