views:

234

answers:

3

Hi, 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? Bcus I need to Upload an image file.

+1  A: 

Hi,

I suppose you can use $_FILES as you whish.

Still, the best way to be sure is to use something like

var_dump($_FILES);

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 use move_uploaded_file to manipulate the file.


Still, if you are using forms, you could take a look at Zend_Form and Zend_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 ;-) )

Pascal MARTIN
Thanks, Zend_From had been added since 1.5. btw I'm using this old version to get learning from the Practical Web 2.0 app in php (it's an old book) I'm planning to migrate to newer version as soon as I finish my 1st project
Omar Dolaimy
OK! Thanks for the explanation about "why the old version" :-) Have fun!
Pascal MARTIN
I would advise against your approach at looking at the old and then migrating to the new. The newer versions are reasonably different from the 1.0.x days (hell there are major changes from 1.7-1.9)
Akeem
Good idea... But I tried to use the latest version (1.9.1) and I found that it's filled with bugs so I lost the enthusiasm to gain the hot features. And Of course I'll "migrate" to the latest STABLE version (like 1.8.x) a soon as I finish my current project with ZF-1.0.4
Omar Dolaimy
A: 

If anyone else still use this version.
I recommend you use the HTTP_Upload class from the sweet PEAR library.

Omar Dolaimy
A: 

hi can anyone tell me how to migrate zend framwork from 1.0.x to 1.10 ?. Please try to reply asap

santosh_c