getUserInput(JetBackup::ID_FIELD, 0, UserInput::UINT); } /** * @return void * @throws AjaxException * @throws DBException * @throws IOException * @throws InvalidArgumentException * @throws NotificationException */ public function execute(): void { if(!$this->_getId()) throw new AjaxException("No download id provided"); $download = new Download($this->_getId()); if(!$download->getId()) throw new AjaxException("Invalid download id provided"); $file = Factory::getLocations()->getDownloadsDir() . JetBackup::SEP . $download->getLocation(); if (file_exists($file)) @unlink($file); Alert::add('Download Deleted', "Download item ". $download->getFilename() . " removed by user", Alert::LEVEL_INFORMATION); $download->delete(); $this->setResponseMessage('Deleted Successfully'); } }