Zum Inhalt springen

Kennt jemand diese Fehlermeldung? - Kommt bei Fileupload im FE

Erstellt am 5. Juli 2007 · 3 Antworten · letzte Antwort am 5. Juli 2007

Tags: Datei-Upload, PHP, Frage

SRitter ·

Warning: requireonce(...t3lib/class.t3lib_basicfilefunctions.php): failed to open stream: No such file or directory in ...t3lib/class.t3lib_div.php on line 4107

Fatal error: requireonce(): Failed opening required '...t3lib/class.t3lib_basicfilefunctions.php' (include_path='.:/usr/local/lib/php') in ...t3lib/class.t3lib_div.php on line 4107

Danke

SRitter ·

das würde ich mir auch denken - auf den ersten Blick...
aber die Datei existiert, der Pfad zum Ordner ist auch richtig (wie sollte TYPO3 auch funktionieren ohne den t3lib Ordner), und die rechte sind bei allen Dateien in diesem Ordner gleich gesetzt...
Der Pfad existiert, die Datei existiert... und ich denke, das t3lib.basicfilefunc.php sicherlich auch im BE benutzt wird für File-Uploads...

Folgende Funktion in der Extension löst die Exception aus:

/**
	 * Handle the uploading of images
	 *
	 * @param	string		$fieldName the field for the uploaded image
	 * @return	array		the array holding image info
	 */
	function uploadImages($fieldName) {
		$fileArray = array();
		$numFiles = isset($_FILES[$this->prefixId]['name'][$fieldName]) && is_array($_FILES[$this->prefixId]['name'][$fieldName]) ? count($_FILES[$this->prefixId]['name'][$fieldName]) : isset($_FILES[$this->prefixId]['name'][$fieldName]);
		if (!$numFiles)
			return 0;
		for ($i = 0; $i < $numFiles; $i++ ) {
			$img = 0;
			$imgName    = ($numFiles > 1) ? $_FILES[$this->prefixId]['name'][$fieldName][$i] : $_FILES[$this->prefixId]['name'][$fieldName];
			$imgSize    = ($numFiles > 1) ? $_FILES[$this->prefixId]['size'][$fieldName][$i] : $_FILES[$this->prefixId]['size'][$fieldName];
			$imgType    = ($numFiles > 1) ? $_FILES[$this->prefixId]['type'][$fieldName][$i] : $_FILES[$this->prefixId]['type'][$fieldName];
			$imgTmpName = ($numFiles > 1) ? $_FILES[$this->prefixId]['tmp_name'][$fieldName][$i] : $_FILES[$this->prefixId]['tmp_name'][$fieldName];
			if ($imgSize && $imgTmpName) {
				$this->fileFunc = t3lib_div::makeInstance('t3lib_basicFileFunctions');
				$imgName = $this->fileFunc->cleanFileName($imgName);
				$imgPath  = PATH_site.$this->altImagePath;
				$imgUniqueName = $this->fileFunc->getUniqueName($imgName,$imgPath);
				move_uploaded_file($imgTmpName,$imgUniqueName);
				$imgPathInfo = pathinfo($imgUniqueName);
				array_push($fileArray,$imgName);
			}
		}
		return $fileArray;
	}