storage updates

This commit is contained in:
Vijay Sebastian
2017-05-12 11:45:21 +05:30
parent f06f07c10e
commit 03cdb3976b
3 changed files with 90 additions and 88 deletions

View File

@@ -30,8 +30,15 @@ class Ticket_attachments extends Model
}
if ($drive && $drive !== 'database') {
$storage = new \App\FaveoStorage\Controllers\StorageController();
$content = $storage->getFile($drive, $name);
$value = base64_encode($content);
$content = $storage->getFile($drive, $name, $root);
if ($content) {
$value = base64_encode($content);
//dd($content);
if (mime($this->type) != 'image') {
$root = $root . "/" . $name;
chmod($root, 1204);
}
}
}
return $value;