|
|||
|
I was up till 04:00 this morning going mad over this problem, so I hope someone can help.
The first one should be simple. I'm trying to create a custom error message for an empty file form element: PHP Code:
Code:
* The file 'cv' was not uploaded
* Value is empty, but a non-empty value is required
The second problem is the main one driving me crazy. if I fill in the whole form so it's valid, when it comes to moving the uploaded file via "$adapter->receive()", I get this message: Code:
["fileUploadErrorAttack"] => string(51) "The file 'cv' was illegal uploaded, possible attack" PHP Code:
PHP Code:
Code:
exception 'Zend_Form_Element_Exception' with message 'Method receive does not exist' in
C:\xampp\php\library\ZendFramework-1.6.1\library\Zend\Form\Element.php:911 Stack trace: #0 [internal function]: Zend_Form_Element->__call('receive', Array) #1
C:\xampp\htdocs\rgac.co.uk\application\default\controllers\JobController.php(175): Zend_Form_Element_File->receive() #2
C:\xampp\php\library\ZendFramework-1.6.1\library\Zend\Controller\Action.php(502): JobController->detailsAction() #3
C:\xampp\php\library\ZendFramework-1.6.1\library\Zend\Controller\Dispatcher\Standard.php(293): Zend_Controller_Action->dispatch('detailsAction') #4
C:\xampp\php\library\ZendFramework-1.6.1\library\Zend\Controller\Front.php(946): Zend_Controller_Dispatcher_Standard->dispatch(Object(Zend_Controller_Request_Http), Object(Zend_Controller_Response_Http)) #5
C:\xampp\htdocs\rgac.co.uk\public_html\index.php(65): Zend_Controller_Front->dispatch() #6 {main}
Am I doing something wrong here? |
|
|||
|
There is a simple reason...
Translating error messages does not work for the file transfer component with 1.6.1. Simply use SVN trunk and you will succeed.
__________________
Greetings Thomas Weidner I18N Team Leader, Zend Framework http://www.thomasweidner.com |
|
|||
|
Quote:
Will "$form->cv->receive()" work with the latest code in trunk? Any idea when the next stable version will be released? |
|
|||
|
I know as much as you but I think it's expected between 3 weeks and Christmas
![]()
__________________
Greetings Thomas Weidner I18N Team Leader, Zend Framework http://www.thomasweidner.com |
|
|||
|
Release...
receive() is already implemented in the element since about 2 weeks.
__________________
Greetings Thomas Weidner I18N Team Leader, Zend Framework http://www.thomasweidner.com |
|
|||
|
I now have 1.6.2 installed, and receive() works fine. However, I still cannot manage to set a custom error message if a file is not uploaded.
Here's my code: PHP Code:
|
|
|||
|
I don't know Zend_Form in detail... it's not my component
... but my understanding is that translating messages works different.
__________________
Greetings Thomas Weidner I18N Team Leader, Zend Framework http://www.thomasweidner.com |
|
|||
|
Quote:
Quick Question If I don't want to keep the uploaded file, how can I get the temporary filename via your component? For example, after validating the form, I want to attach the uploaded file to an email, then I no longer need it. I'd normally use something like this: PHP Code:
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|