[TYPO3-english] Formhandler and file uploading

Victor Livakovsky v-tyok at mail.ru
Mon May 3 12:58:23 CEST 2010


Hi, List.

I'm using a formhandler extension v. 0.9.7 and want to use it's file upload 
and storing features.
The first issue I have with Tx_Formhandler_PreProcessor_ClearTempFiles. When 
it is enabled, I'm getting the following error:
Fatal error: Access level to 
Tx_Formhandler_PreProcessor_ClearTempFiles::init() must be public (as in 
class Tx_Formhandler_AbstractComponent) in 
/home/www/typo3conf/ext/formhandler/Classes/PreProcessor/Tx_Formhandler_PreProcessor_ClearTempFiles.php 
on line 32

Here is TS:
  preProcessors {
    1.class = Tx_Formhandler_PreProcessor_ClearTempFiles
    1.config {
      clearTempFilesOlderThan {
        value = 24
        unit = hours
      }
    }
  }


Second issue is related to mandatory file upload field. I'm using one filed, 
that let user upload up to 5 files, but at least one file should be 
uploaded.
The HTML code of a field:
  <label for="picture">###LLL:picture### ###required_picture###</label>
  <input type="file" name="formhandler[picture]" id="picture" 
value="###value_picture###"/>
  <input type="submit" value="Upload file now" ###submit_reload### /><br />
  ###picture_fileCount###/###picture_maxCount###<br />
  ###picture_remainingCount### files left to upload<br />
  <p>Files: ###picture_uploadedFiles###</p>

Here is TS of validation for this field:
        picture.errorCheck.1 = fileAllowedTypes
        picture.errorCheck.1.allowedTypes = jpg,png
        picture.errorCheck.2 = fileMinCount
        picture.errorCheck.2.minCount = 1
        picture.errorCheck.3 = fileMaxCount
        picture.errorCheck.3.maxCount = 5
        picture.errorCheck.4 = fileMaxSize
        picture.errorCheck.4.maxSize = 5242880
        picture.errorCheck.5 = fileMinSize
        picture.errorCheck.5.minSize = 512000
        picture.errorCheck.6 = fileRequired

Everything is cool, but field 'picture' should contain a data, when a total 
form is submitted, even if something was uploaded before by clicking "Upload 
file now" button.
This makes user confused, because he has uploaded some files, but a form 
gives an error, that he needs to upload a file.

Is there any way to make formhandler check if files were already uploaded 
and not to drop an error in that case?

Thank you for any help in advance. 



More information about the TYPO3-english mailing list