Re: Undefined index after web host install.
Right I've done the info.php and file uploads are turned on and you are absolutely right, there is a max file size of 2mb for an upload. Thanks for helping me figure that one out :) Much appreciated. On Thursday, 28 June 2012 22:34:09 UTC+1, Guti Grewal wrote: > > Hi I've uploaded my website on a free hosting site called 000webhost, it > works fine on localhost but however when I try to upload a file to the > server using a form I get thrown this error. > > *Notice* (8): Undefined index: Upload > [*APP/Controller/UploadsController.php*, line *32*] > Code > > UploadsController::add() - APP/Controller/UploadsController.php, line 32 > ReflectionMethod::invokeArgs() - [internal], line ?? > Controller::invokeAction() - CORE/Cake/Controller/Controller.php, line 485 > Dispatcher::_invoke() - CORE/Cake/Routing/Dispatcher.php, line 103 > Dispatcher::dispatch() - CORE/Cake/Routing/Dispatcher.php, line 85 > [main] - APP/webroot/index.php, line 96 > > > I can't for the life of me figure out what is going wrong? > > I've set the permissions for the webroot/files/uploads folder to 777, so it > can't possibly be that. > > Anyone have any ideas? > > -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php
Re: Undefined index after web host install.
On Fri, Jun 29, 2012 at 3:01 PM, Guti Grewal wrote: > Notice (8): Undefined index: Upload [APP/Controller/UploadsController.php, > line 32] > > /app/Controller/UploadsController.php (line 32) > > null > > > This is what I get, when I do the debug, so Im guessing theres no errors > with the coding. Where else could the error be. Well, no, it doesn't mean there are no errors. It means that $this->request->data is empty. Which is not what you want. Where did you put this line? Normally, it would be something like: public function add() { if (!empty($this->request->data)) { // do save here debug($this->request->data); Which version are you running, btw? If less than 2.x you need to debug($this->data) instead. It's odd that both the notice and the debug are on line 32. What does your controller action look like? > It works fine in localhost but once I uploaded it to the online web host I > get thrown this error. Then maybe the problem is that you're trying to upload a file that's too large. Or you may not even be able to upload at all. Add this in your controller: debug($_FILES); If there's an upload error it'll be included there and you can compare with the examples on the PHP site. Also, you could check the server's config. Write a script, info.php, and stick it in your webroot dir: http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php
Re: Undefined index after web host install.
*Notice* (8): Undefined index: Upload [*APP/Controller/UploadsController.php*, line *32*] */app/Controller/UploadsController.php* (line *32*) null This is what I get, when I do the debug, so Im guessing theres no errors with the coding. Where else could the error be. It works fine in localhost but once I uploaded it to the online web host I get thrown this error. This is my form; Form->create('Upload', array('controller'=>'uploads','action'=>'add','type' => 'file', 'class'=>'uploadfrm'));?> Upload a Video .mp4 file format only.'; echo ''; echo ''; echo $this->Form->input('name', array('between'=>'', 'class'=>'input')); echo $this->Form->input('eventname', array('between'=>'', 'class'=>'input')); echo $this->Form->input('description', array('between'=>'', 'rows'=> '7', 'cols'=> '60', 'class'=>'input')); echo $this->Form->hidden('userid', array('id' => 'user_id','value' => $auth['id'])); echo $this->Form->hidden('username', array('id' => 'username', 'value' => $auth['username'])); echo $this->Form->input('file', array('type' => 'file')); echo ""; ?> Form->end(__('Upload Video', true));?> Any ideas? On Thursday, 28 June 2012 22:34:09 UTC+1, Guti Grewal wrote: > > Hi I've uploaded my website on a free hosting site called 000webhost, it > works fine on localhost but however when I try to upload a file to the > server using a form I get thrown this error. > > *Notice* (8): Undefined index: Upload > [*APP/Controller/UploadsController.php*, line *32*] > Code > > UploadsController::add() - APP/Controller/UploadsController.php, line 32 > ReflectionMethod::invokeArgs() - [internal], line ?? > Controller::invokeAction() - CORE/Cake/Controller/Controller.php, line 485 > Dispatcher::_invoke() - CORE/Cake/Routing/Dispatcher.php, line 103 > Dispatcher::dispatch() - CORE/Cake/Routing/Dispatcher.php, line 85 > [main] - APP/webroot/index.php, line 96 > > > I can't for the life of me figure out what is going wrong? > > I've set the permissions for the webroot/files/uploads folder to 777, so it > can't possibly be that. > > Anyone have any ideas? > > -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php
Re: Undefined index after web host install.
It looks to me like your code is expecting a key, 'Upload' in the request data. What does your form look like? Also, debug($this->request-data) On Thu, Jun 28, 2012 at 5:34 PM, Guti Grewal wrote: > Hi I've uploaded my website on a free hosting site called 000webhost, it > works fine on localhost but however when I try to upload a file to the > server using a form I get thrown this error. > > Notice (8): Undefined index: Upload [APP/Controller/UploadsController.php, > line 32] > Code > > UploadsController::add() - APP/Controller/UploadsController.php, line 32 > ReflectionMethod::invokeArgs() - [internal], line ?? > Controller::invokeAction() - CORE/Cake/Controller/Controller.php, line 485 > Dispatcher::_invoke() - CORE/Cake/Routing/Dispatcher.php, line 103 > Dispatcher::dispatch() - CORE/Cake/Routing/Dispatcher.php, line 85 > [main] - APP/webroot/index.php, line 96 > > > I can't for the life of me figure out what is going wrong? > > I've set the permissions for the webroot/files/uploads folder to 777, so it > can't possibly be that. > > Anyone have any ideas? > > -- > Our newest site for the community: CakePHP Video Tutorials > http://tv.cakephp.org > Check out the new CakePHP Questions site http://ask.cakephp.org and help > others with their CakePHP related questions. > > > To unsubscribe from this group, send email to > cake-php+unsubscr...@googlegroups.com For more options, visit this group at > http://groups.google.com/group/cake-php -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php
Undefined index after web host install.
Hi I've uploaded my website on a free hosting site called 000webhost, it works fine on localhost but however when I try to upload a file to the server using a form I get thrown this error. *Notice* (8): Undefined index: Upload [*APP/Controller/UploadsController.php*, line *32*] Code UploadsController::add() - APP/Controller/UploadsController.php, line 32 ReflectionMethod::invokeArgs() - [internal], line ?? Controller::invokeAction() - CORE/Cake/Controller/Controller.php, line 485 Dispatcher::_invoke() - CORE/Cake/Routing/Dispatcher.php, line 103 Dispatcher::dispatch() - CORE/Cake/Routing/Dispatcher.php, line 85 [main] - APP/webroot/index.php, line 96 I can't for the life of me figure out what is going wrong? I've set the permissions for the webroot/files/uploads folder to 777, so it can't possibly be that. Anyone have any ideas? -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php