[TYPO3-english] Typo3 7.6 Frontend-Upload in pi-extension
Niklas Miketta
nm at cyrano.de
Tue Jul 4 09:43:10 CEST 2017
Hello,
I've got a Typo system running that was created on 4.5, which I upgraded to 7.6 over the last weeks. The original maintainer created an extension with 16 plugins - Fluid is not being used here, it's generating simple HTML-Content via PHP and returning that.
That procedure is plain old and not advised today, I know, but I don't have enough time or knowledge to re-work the whole projekt using Fluid/Extbase.
The page is pretty much finished, but a new request got in last week - a page being filled by `pi16` should contain a simple image upload. Using the simple file input of HTML forms would be enough. My code currently looks like this:
/////////////////////////////////
$is_submitted = (\TYPO3\CMS\Core\Utility\GeneralUtility::_GP('submitted') !== null);
if($is_submitted) {
$postval = \TYPO3\CMS\Core\Utility\GeneralUtility::_GP();
var_dump($_FILES);
print_r($_FILES);
var_dump($postval);
}
$content = '
<form type="POST" action="index.php" id="fu_form" class="form-inline">
<strong>Bild hochladen</strong>
<input type="hidden" name="MAX_FILE_SIZE" value="100000" />
<input type="file" name="file_img">
<input type="submit" name="submitted" text="Abschicken" />
</form>';
return $this->pi_wrapInBaseClass($content);
////////////////
var_dumps and print_r are returning this, in order:
array(0) { }
Array ( )
string(7) "img.jpg"
The $_FILES-Array is empty and I can't use the POST object to upload files. I've been working on this for 4 days, tried different things (using Fluid in pi-Extension, implementing a form as external template, etc.) but haven't been successful yet.
It would be awesome if someone could point me in the right direction as I'm really not getting any further - thanks in advance to anyone trying to help!
Best regards
Niklas
More information about the TYPO3-english
mailing list