1
0
mirror of https://github.com/BookStackApp/BookStack.git synced 2025-07-31 15:24:31 +03:00

File upload deletion complete & added extension handling

Also fixed issue with file editing on JS side
This commit is contained in:
Dan Brown
2016-10-23 13:36:45 +01:00
parent 867fc8be64
commit 7ee695d74a
6 changed files with 26 additions and 7 deletions

View File

@ -5,6 +5,16 @@ class File extends Ownable
{
protected $fillable = ['name', 'order'];
/**
* Get the downloadable file name for this upload.
* @return mixed|string
*/
public function getFileName()
{
if (str_contains($this->name, '.')) return $this->name;
return $this->name . '.' . $this->extension;
}
/**
* Get the page this file was uploaded to.
* @return Page