aboutsummaryrefslogtreecommitdiff
path: root/mod/file/actions/file/upload.php
diff options
context:
space:
mode:
authorRussell McLoughlin <mcloughlin3@llnl.gov>2011-06-01 11:25:31 -0700
committerRussell McLoughlin <mcloughlin3@llnl.gov>2011-06-01 11:25:31 -0700
commit2850bfb915fa5dc28d290910cba1c97b0c7e3b50 (patch)
tree0a06a330954d23d0711307d812da02bf7bbddaa5 /mod/file/actions/file/upload.php
parentb13240c84141a54683e918e33847251d00f67098 (diff)
downloadelgg-2850bfb915fa5dc28d290910cba1c97b0c7e3b50.tar.gz
elgg-2850bfb915fa5dc28d290910cba1c97b0c7e3b50.tar.bz2
Modified upload code so that it uses php's built in file copy function rather than reading the entire uploaded file into memory from the temporary upload directory and then saving it to elgg's data dir.
Diffstat (limited to 'mod/file/actions/file/upload.php')
-rw-r--r--mod/file/actions/file/upload.php4
1 files changed, 1 insertions, 3 deletions
diff --git a/mod/file/actions/file/upload.php b/mod/file/actions/file/upload.php
index e04203f67..fe93661f2 100644
--- a/mod/file/actions/file/upload.php
+++ b/mod/file/actions/file/upload.php
@@ -106,9 +106,7 @@ if (isset($_FILES['upload']['name']) && !empty($_FILES['upload']['name'])) {
$file->originalfilename = $_FILES['upload']['name'];
$file->simpletype = file_get_simple_type($_FILES['upload']['type']);
- $file->open("write");
- $file->write(get_uploaded_file('upload'));
- $file->close();
+ move_uploaded_file($_FILES['upload']['tmp_name'], $file->getFilenameOnFilestore());
$guid = $file->save();