Hey there, I’m using the tutorial at http://www.jamesfairhurst.co.uk/posts/view/uploading_files_and_images_with_cakephp to try to get myself up and running with the ability to upload images.
Now, I’m very new, and really haven’t a clue so this is probably the most stupid question in the world but I don’t know whats going on.
Basically I follow the tutorial as best I can but when I load the page which is supposed to have the input for the image I get the rest of the form but then get 2 errors:
Method FormHelper::labelTag does not exist
and
Method HtmlHelper::file does not exist
I’ve searched but only got more confused. There is something I’m meant to include that i’ve missed isn’t there?
confused…
I assume you’ve put the
uploadFilesfunction in to yourAPP/app_controller.phpYou would do something like this in your
addaction, for instance:What version of Cake are you using? That tutorial is quite old, and whilst the upload functionality still works fine, the
labelTagandFilemethods are now deprecated (as of 1.3 I think). you should use:instead, and you should be good to go.
edit
You can also just use
echo $this->Form->input('File.range_image', array('type'=>'file'));as if I recall, that’s the preferred way ~