contao/test — Issue #2622: Contao Datei-Upload Feld
Author: importer
Created: 2011-11-29 09:59:43+00:00
State: closed
Labels: Defect, frontend, Invalid

Hallo,

wenn man ein Formular mit einigen Pflichtfelder und einem Datei-Upload Feld (kein Pflichtfeld) erstellt, dann kommt es zu einem Fehler unter folgenden Voraussetzungen:
- Pflichtfelder ausfüllen - eines aber leer lassen
- Datei zum Upload auswählen
- Auf absenden klicken
- Jetzt erscheint die Meldung das man vergessen hat ein Pflichtfeld auszufüllen
- Feld ausfüllen und noch mal auf absenden klicken.

Jetzt kommt es zu einer Fehlermeldung:

```
Warning: file_get_contents(/tmp/phpBJqawo) [function.file-get-contents]: failed to open stream: No such file or directory in.../contao/system/modules/frontend/Form.php on line 381
#0.../contao/system/modules/frontend/Form.php(381): __error(2, 'file_get_conten...', '/kunden/108564_...', 381, Array)
#1.../contao/system/modules/frontend/Form.php(208): Form->processFormData('/tmp/phpBJqawo')
#2.../contao/system/modules/frontend/Hybrid.php(152): Form->compile(Array)
#3.../contao/system/modules/frontend/Form.php(74): Hybrid->generate()
#4.../contao/system/libraries/Controller.php(415): Form->generate()
#5.../contao/system/modules/frontend/ModuleArticle.php(173): Controller->getContentElement()
#6.../contao/system/modules/frontend/Module.php(129): ModuleArticle->compile('80')
#7.../contao/system/modules/frontend/ModuleArticle.php(71): Module->generate()
#8.../contao/system/libraries/Controller.php(348): ModuleArticle->generate()
#9.../contao/system/libraries/Controller.php(221): Controller->getArticle(false)
#10.../contao/system/modules/frontend/PageRegular.php(71): Controller->getFrontendModule('1', false, false, 'main')
#11.../contao/index.php(198): PageRegular->generate('0', 'main')
#12.../contao/index.php(329): Index->run(Object(DB_Mysql_Result))
#13 {main}

Fatal error: Uncaught exception Swift_RfcComplianceException with message Address in mailbox given [] does not comply with RFC 2822, 3.6.2. thrown in.../contao/plugins/swiftmailer/classes/Swift/Mime/Headers/MailboxHeader.php on line 309
#0.../contao/plugins/swiftmailer/classes/Swift/Mime/Headers/MailboxHeader.php(239): Swift_Mime_Headers_MailboxHeader->_assertValidAddress('')
#1.../contao/plugins/swiftmailer/classes/Swift/Mime/Headers/MailboxHeader.php(97): Swift_Mime_Headers_MailboxHeader->normalizeMailboxes(Array)
#2.../contao/plugins/swiftmailer/classes/Swift/Mime/Headers/MailboxHeader.php(61): Swift_Mime_Headers_MailboxHeader->setNameAddresses(Array)
#3.../contao/plugins/swiftmailer/classes/Swift/Mime/SimpleMimeEntity.php(571): Swift_Mime_Headers_MailboxHeader->setFieldBodyModel(Array)
#4.../contao/plugins/swiftmailer/classes/Swift/Mime/SimpleMessage.php(199): Swift_Mime_SimpleMimeEntity->_setHeaderFieldModel('From', Array)
#5.../contao/system/libraries/Email.php(441): Swift_Mime_SimpleMessage->setFrom('')
#6.../contao/system/modules/frontend/Form.php(389): Email->sendTo(Array)
#7.../contao/system/modules/frontend/Form.php(208): Form->processFormData(Array)
#8.../contao/system/modules/frontend/Hybrid.php(152): Form->compile()
#9.../contao/system/modules/frontend/Form.php(74): Hybrid->generate()
#10.../contao/system/libraries/Controller.php(415): Form->generate()
#11.../contao/system/modules/frontend/ModuleArticle.php(173): Controller->getContentElement('80')
#12.../contao/system/modules/frontend/Module.php(129): ModuleArticle->compile()
#13.../contao/system/modules/frontend/ModuleArticle.php(71): Module->generate()
#14.../contao/system/libraries/Controller.php(348): ModuleArticle->generate(false)
#15.../contao/system/libraries/Controller.php(221): Controller->getArticle('1', false, false, 'main')
#16.../contao/system/modules/frontend/PageRegular.php(71): Controller->getFrontendModule('0', 'main')
#17.../contao/index.php(198): PageRegular->generate(Object(DB_Mysql_Result))
#18.../contao/index.php(329): Index->run()
#19 {main}
```

Die Email wird trotzdem versendet ... und im Anhang befindet sich eine korrupte Datei ( hab es nur mit Bildern getestet )

--- _Originally created by apache on October 18th, 2010, at 08:32am (ID 2622)_