[TYPO3-project-formidable] How to delete a file from a FILE renderlet?
Jerome Schneider
j.schneider at ameos.com
Wed Jun 13 10:14:08 CEST 2007
Hello Manuel,
For the moment rdt_file shamefuly lacks a button to clear the field in
the HTML and in the DB ...
But there's clearly the need for such an obvious feature.
How would you see this in the interface ? A link "Clear" next to the
file input ?
Gimme the ideas !
Jerome Schneider
Manuel Rego Casasnovas a écrit :
> Hi.
>
> I've solved my first problem, I've modified the source code of the
> _flatten function in the tx_rdtfile class, and add three lines:
> ...
> if(move_uploaded_file($tmp_name, $target)) {
>
> $this->oForm->_debug("moving from <b>[" . $tmp_name
> . "]</b> to <b>[" . $target . "]</b>", "RDT FILE " . $this->_getName() .
> " - FILE CORRECTLY UPLOADED AND STORED");
> $sFile = $basename;
>
> // Lines added
> $dFile =
> $this->getFullServerPath(basename($mData["backup"]));
> if(file_exists($dFile)) {
> unlink($dFile);
> }
>
> }
> ...
>
> With this I delete the files, when I upload a new file.
>
> Only one problem now, delete a file without upload another file.
>
>
> Bye,
> Rego
>
>
More information about the TYPO3-project-formidable
mailing list