aboutsummaryrefslogtreecommitdiff
path: root/mod/file/actions
diff options
context:
space:
mode:
Diffstat (limited to 'mod/file/actions')
-rw-r--r--mod/file/actions/upload.php38
1 files changed, 18 insertions, 20 deletions
diff --git a/mod/file/actions/upload.php b/mod/file/actions/upload.php
index 255d8ef06..1f5107bf0 100644
--- a/mod/file/actions/upload.php
+++ b/mod/file/actions/upload.php
@@ -21,26 +21,24 @@
$result = $file->save();
if ($result)
- system_message(elgg_echo("file:saved"));
- else
- system_message(elgg_echo("file:uploadfailed"));
-
- $file->setFilename($_FILES['upload']['name']);
- $file->setMimeType($_FILES['upload']['type']);
-
- $file->open("write");
- $file->write(get_uploaded_file('upload'));
- $file->close();
-
- $file->title = $title;
- $file->description = $desc;
-
- $result = $file->save();
-
- // Save tags
- $tags = explode(",", $tags);
- $file->tag = $tags;
-
+ {
+ $file->setFilename($_FILES['upload']['name']);
+ $file->setMimeType($_FILES['upload']['type']);
+
+ $file->open("write");
+ $file->write(get_uploaded_file('upload'));
+ $file->close();
+
+ $file->title = $title;
+ $file->description = $desc;
+
+ $result = $file->save();
+
+ // Save tags
+ $tags = explode(",", $tags);
+ $file->tag = $tags;
+ }
+
if ($result)
system_message(elgg_echo("file:saved"));
else