Example #1
0
 /**
  * File Uploader
  *
  * @return void
  */
 public function fileUploadAction()
 {
     $fileName = FileUtility::uploadFile();
     header('Content-Type: text/plain');
     $result = ['success' => $fileName ? true : false, 'uploadName' => $fileName];
     echo json_encode($result);
 }
Example #2
0
 /**
  * Assigns all values, which should be available in all views
  *
  * @return void
  */
 public function assignForAll()
 {
     $this->view->assignMultiple(['languageUid' => FrontendUtility::getFrontendLanguageUid(), 'storagePid' => $this->allConfig['persistence']['storagePid'], 'Pid' => FrontendUtility::getCurrentPid(), 'uploadFolder' => FileUtility::getUploadFolderFromTca()]);
 }
Example #3
0
 /**
  * Test for checkExtension()
  *
  * @param string $givenValue
  * @param string $expectedResult
  * @return void
  * @dataProvider checkExtensionReturnBoolDataProvider
  * @test
  */
 public function checkExtensionReturnBool($givenValue, $expectedResult)
 {
     $result = FileUtility::checkExtension($givenValue);
     $this->assertEquals($result, $expectedResult);
 }