english/components/com_aicontactsafe/models/message.php
// function to delete an uploaded file ( on the cancel button is pressed )
function to delete an uploaded file ( on the cancel button is pressed )
function to delete an uploaded file ( on the cancel button is pressed )
function deleteUploadedFile() {
		$r_id = JRequest::getVar('r_id', 0, 'request', 'int');
		$filename = JRequest::getVar('filename', '', 'request', 'cmd');
		jimport('joomla.filesystem.file');
		$upload_folder = str_replace('\\',DS,$this->_config_values['upload_attachments']);
		$upload_folder = str_replace('/',DS,$upload_folder);
		$upload_folder = str_replace('&#92;',DS,$upload_folder);
		$path_upload = JPATH_ROOT.DS.$upload_folder;
		$file = $path_upload.DS.$filename;
		if (JFile::exists($file)) {
			JFile::delete($file);
		}
		$db = &JFactory::getDBO();
		$query = 'DELETE FROM #__aicontactsafe_messagefiles WHERE name = \'' . $filename . '\' AND message_id = 0 AND r_id = ' . $r_id;
		$db->setQuery($query);
		$db->query();
	}
function deleteUploadedFile ( ) { $ r_id = JRequest :: getVar ( 'r_id' , 0 , 'request' , 'int' ) ; $ filename = JRequest :: getVar ( 'filename' , '' , 'request' , 'cmd' ) ; jimport ( 'joomla.filesystem.file' ) ; $ upload_folder = str_replace ( '\\' , DS , $ this -> _config_values [ 'upload_attachments' ] ) ; $ upload_folder = str_replace ( '/' , DS , $ upload_folder ) ; $ upload_folder = str_replace ( '&#92;' , DS , $ upload_folder ) ; $ path_upload = JPATH_ROOT . DS . $ upload_folder ; $ file = $ path_upload . DS . $ filename ; if ( JFile :: exists ( $ file ) ) { JFile :: delete ( $ file ) ; } $ db = & JFactory :: getDBO ( ) ; $ query = 'DELETE FROM #__aicontactsafe_messagefiles WHERE name = \'' . $ filename . '\' AND message_id = 0 AND r_id = ' . $ r_id ; $ db -> setQuery ( $ query ) ; $ db -> query ( ) ; }
function to delete an uploaded file ( on the cancel button is pressed )
function to delete an uploaded file ( on the cancel button is pressed )
// import joomla clases to manage file system // get the path to attachments upload // initialize the database