Beispiel #1
0
 /**
  * Method to upload Content Element file.
  *
  * @return  boolean  True if successful, false otherwise.
  */
 public function uploadWebservice()
 {
     // Check for request forgeries.
     JSession::checkToken() or jexit(JText::_('JINVALID_TOKEN'));
     $app = JFactory::getApplication();
     $files = $app->input->files->get('redcoreWebservice', array(), 'array');
     if (!empty($files)) {
         $uploadedFiles = RApiHalHelper::uploadWebservice($files);
         if (!empty($uploadedFiles)) {
             $app->enqueueMessage(JText::_('COM_REDCORE_WEBSERVICES_UPLOAD_SUCCESS'));
         }
     } else {
         JFactory::getApplication()->enqueueMessage(JText::_('COM_REDCORE_WEBSERVICES_UPLOAD_FILE_NOT_FOUND'), 'warning');
     }
     $this->redirectAfterAction();
 }