Re: Initiating a 'DELETE' or 'POST' in a folder inside webroot

2013-12-22 Thread AD7six


On Saturday, 21 December 2013 13:31:38 UTC+1, Charles Martin Mendez wrote:
>
> Hi,
>
> I am using the fileupload jquery library. I was able to get everything 
> working and migrated some functions to the controllers to make it 
> compatible.
>
> The problem I am encountering is that fileupload is creating a 'Delete' 
> button which goes to the link below:
> http://localhost/homsite/app/webroot/?file=
> *SAMPLE%PICTURE.JPG*
>
> The button's property is data-type="DELETE"
>
> Basically what this should do is initiate a DELETE in the 'file' folder to 
> remove "SAMPLE PICTURE.JPG"
>
> I have tried this with a plain PHP setup and it is working fine.
>

What php file is answering the request in that case?
 

>
> Looking at the error returned, cakephp is routing the link to the 
> controller:
> Missing Method in AppController
>
> Error: The action webroot is not defined in controller AppController
>
> Error: Create AppController::webroot() in file: 
> app\Controller\AppController.php.
>
>  class AppController extends AppController {
>
>   public function webroot() {
>
>   }
> }
>
>
> Read the above as "404 Not found". 

>
> Is it possible to make cakephp exempt the MVC for that particular link?
>

That's not what you want to do. Cake does not "hijack" urls that map to 
files in the webroot. If you've put a file in the webroot for handling the 
deleting of uploaded files, you need only point at it (i.e. the url needs 
to explicitly point at the same file for "a plain PHP setup" for the same 
processing to occur).

hth,

AD

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/groups/opt_out.


Initiating a 'DELETE' or 'POST' in a folder inside webroot

2013-12-22 Thread Charles Martin Mendez
Hi,

I am using the fileupload jquery library. I was able to get everything 
working and migrated some functions to the controllers to make it 
compatible.

The problem I am encountering is that fileupload is creating a 'Delete' 
button which goes to the link below:
http://localhost/homsite/app/webroot/?file=*SAMPLE%PICTURE.JPG*

The button's property is data-type="DELETE"

Basically what this should do is initiate a DELETE in the 'file' folder to 
remove "SAMPLE PICTURE.JPG"

I have tried this with a plain PHP setup and it is working fine.

Looking at the error returned, cakephp is routing the link to the 
controller:
Missing Method in AppController

Error: The action webroot is not defined in controller AppController

Error: Create AppController::webroot() in file: 
app\Controller\AppController.php.

https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/groups/opt_out.