I’m Using ZendFramework-1.0.4 and I don’t have any idea how does it wrap the $_FILE global-variable.
Is it a good idea to use it directly in my Controller?
I need to Upload an image file.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
I suppose you can use
$_FILESas you whish.Still, the best way to be sure is to use something like
somewhere in you controller ; this way, you’ll see if it contains what you expect 😉
Then, don’t forget to use
is_uploaded_file; and, you can usemove_uploaded_fileto manipulate the file.Still, if you are using forms, you could take a look at
Zend_FormandZend_Form_Element_File, which will do some work for you.Hu… Actually : not sure those were present in ZF 1.0.x 🙁
As a sidenote : Zend Framework 1.0.4 is quote old (was released in frebruary 2008 ; see the archives page) ; it is no longer maintained, and there have been several versions released since. Would it not be useful for you to update ?
(Would probably require some work, though, for such an update, as lots of things have changed… But there are many components that have been added, and could be useful for your project, too 😉 )