X-Git-Url: http://wagnertech.de/gitweb/gitweb.cgi/timetracker.git/blobdiff_plain/7420fa50ea7e810db85bcb7ced55dc01d21fafcd..c45c90dc951017a163a3ee72bd6e26d291ceb642:/WEB-INF/lib/ttFileHelper.class.php diff --git a/WEB-INF/lib/ttFileHelper.class.php b/WEB-INF/lib/ttFileHelper.class.php index 5c9b385b..7c8324b6 100644 --- a/WEB-INF/lib/ttFileHelper.class.php +++ b/WEB-INF/lib/ttFileHelper.class.php @@ -135,7 +135,7 @@ class ttFileHelper { 'user_key' => urlencode($fields['user_key']), // May be null. 'file_name' => urlencode($fields['file_name']), 'description' => urlencode($fields['description']), - // TODO: add file content here, too. Will this work for large files? + 'content' => urlencode(file_get_contents($_FILES['newfile']['tmp_name'])) ); // url-ify the data for the POST. @@ -167,7 +167,7 @@ class ttFileHelper { $file_key = $result_array['file_key']; $error = $result_array['error']; - if (!$file_id || !$file_key) { + if ($error || !$file_id || !$file_key) { if ($error) { // Add an error from file storage facility if we have it. $this->errors->add($error);