Ich arbeite gerade an einer Extension, wo Benutzer, die Möglichkeit haben sollen Dateien im Backend hochladen zu können, die dann verarbeitet werden.
Unter Windows auf meinem lokalen System funktioniert das auch einwandfrei, aber auf dem Produktivsystem (auf dem wahrscheinlich Linux läuft), passiert einfach nichts. Es wird keine Datei übertragen. Die Frage iat warum, ich habe leider keine Idee.
$inData = t3lib_div::_GP('tx_bibtexdb');
$newFile = $this->checkUpload();
if ($inData['settings']['uploadfile']) {
$absFile = $inData['settings']['uploadfile'];
}
if (!empty($newFile) && file_exists($newFile)) {
//Blababla
}
Hier noch die Funktionen.
function userTempFolder() {
global $FILEMOUNTS;
foreach($FILEMOUNTS as $filePathInfo) {
$tempFolder = $filePathInfo['path'].'_temp_/';
if (@is_dir($tempFolder)) {
return $tempFolder;
}
}
}
function checkUpload() {
global $FILEMOUNTS,$TYPO3_CONF_VARS,$BE_USER;
$file = t3lib_div::_GP('file');
//$inData = t3lib_div::_GP('tx_bibtexdb');
// Initializing:
$this->fileProcessor = t3lib_div::makeInstance('t3lib_extFileFunctions');
$this->fileProcessor->init($FILEMOUNTS, $TYPO3_CONF_VARS['BE']['fileExtensions']);
$this->fileProcessor->init_actionPerms($BE_USER->user['fileoper_perms']);
$this->fileProcessor->dontCheckForUnique = 1; //($inData['preset']['overwriteExistingFiles']) ? 1 : 0;
// Checking referer / executing:
$refInfo = parse_url(t3lib_div::getIndpEnv('HTTP_REFERER'));
$httpHost = t3lib_div::getIndpEnv('TYPO3_HOST_ONLY');
if ($httpHost != $refInfo['host'] && $this->vC != $BE_USER->veriCode() && !$TYPO3_CONF_VARS['SYS']['doNotCheckReferer']) {
$this->fileProcessor->writeLog(0,2,1,'Referer host "%s" and server host "%s" did not match!',array($refInfo['host'],$httpHost));
} else {
$this->fileProcessor->start($file);
$newfile = $this->fileProcessor->func_upload($file['upload']['1']);
t3lib_extFileFunctions::processData();
}
return $newfile;
}