[TYPO3-english] Mailformplus and multiple file upload
Reinhard Führicht
rf at typoheads.at
Fri Aug 14 11:20:02 CEST 2009
Hi Victor,
fist of all I advice you to use the extension 'formhandler' in the
future because it is the successor of th_mailformplus (which will not be
maintained any further).
In Formhandler (and mostly in th_mailformplus too) it works this way:
In order to make a multiple file upload possible you have a special
marker called ###submit_reload###. You place this along with a submit
button and the form will not go to the next step but stay at the current
step and perform file uploads.
When using th_mailformplus you have to search in the manual for that
feature because I don't remember how it worked there. I only remember
that in th_mailformplus multiple file upload is only possible in multi
step forms. There is a similar marker to ###submit_reload### in
th_mailformplus too. Just search the manual for it.
Example for Formhandler:
<input type="file" name="cv" id="cv" size="20"/>
<input type="submit" value="Upload file now" ###submit_reload###/>
TypoScript:
plugin.Tx_Formhander.settings {
...
validators.1.class = Validator_Default
validators.1.config.fieldConf {
cv {
errorCheck {
1 = fileMinCount
1.minCount = 1
2 = fileMaxCount
2.maxCount = 5
}
}
}
...
}
This basically allows the user to upload up to 5 files but at least 1.
Workflow:
- The user browses for a file and clicks "upload file now".
- The user repeats this action until he has uploaded all files he wants
- The user clicks "next" or "send" to go to next step of the form.
Cheers,
Reinhard
Victor Livakovsky schrieb:
> Hi, List.
>
> I'm using 'th_mailformplus' extension and want to allow user to send
> more, than one file within one file upload field (which mailformplus
> should allow), but can't understand, how can I organise that?
>
> I have this in my HTML template (almost same as in example):
> <label for="cv">CV:</label>
> number of allowed files: ###cv_numberOfAllowedFiles###<br />
> allowed file types: ###cv_fileTypes###<br />
> allowed file size per file: ###cv_fileSize###<br />
> already uploaded files: ###cv_numberOfUploadedFiles###<br />
> remaining files: ###cv_numberOfRemainingFiles###<br />
> ###error_cv######value_cv###<input type="file" name="cv" id="cv"
> size="20" maxlength="50000" accept="*.pdf,*.doc" />
>
>
> This in TS setup:
> plugin.tx_thmailformplus_pi1.fieldConf {
> cv {
> numberOfAllowedFiles = 3
> fileTypes = pdf,doc
> fileSize = 500000
> fileUpload = fileadmin/user_upload/cv/
> errorCheck = required
> uploadedFiles {
> template = ###fileName###
> ###fileSize######linkDelete_start###delete###linkDelete_stop###<br/>
> wrap = <div>|</div>
> }
> uploadedFiles.mail {
> plainTemplate = ###filePath######fileName###
> HTMLTemplate = <a
> href="###filePath######fileName###">###fileName###</a><br/>
> }
> }
> }
>
>
> But I really can't see, how this feature should work. I assume, that
> there must be some additional JS code and some additional link "upload
> file", which uploads file only without sending whole form data, but
> can't find a way to do that.
>
> If you have an experience with it, give me, please, some hint.
>
> Thank you in adavnce.
More information about the TYPO3-english
mailing list