Check filesize is greater than zero before deleteing a file from library
This commit is contained in:
parent
7edd993fa3
commit
7018f45c0a
1 changed files with 3 additions and 0 deletions
|
@ -383,6 +383,9 @@ SQL;
|
||||||
Logging::info("User ".$user->getLogin()." is deleting file: ".$this->_file->getDbTrackTitle()." - file id: ".$file_id);
|
Logging::info("User ".$user->getLogin()." is deleting file: ".$this->_file->getDbTrackTitle()." - file id: ".$file_id);
|
||||||
|
|
||||||
$filesize = $this->_file->getFileSize();
|
$filesize = $this->_file->getFileSize();
|
||||||
|
if ($filesize <= 0) {
|
||||||
|
throw new Exception("Cannot delete file with filesize ".$filesize);
|
||||||
|
}
|
||||||
|
|
||||||
//Delete the physical file from either the local stor directory
|
//Delete the physical file from either the local stor directory
|
||||||
//or from the cloud
|
//or from the cloud
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue