Friday, December 31, 2010

Re: Downloadable files without mod_rewrite

Debug is set to 2, but it's not throwing any error messages, or even
the SQL output. Is there a setting that would be supressing that
output?

Thanks


On Dec 30, 7:21 pm, cricket <zijn.digi...@gmail.com> wrote:
> On Thu, Dec 30, 2010 at 10:28 AM, WhyNotSmile <sharongilmor...@gmail.com> wrote:
> > I'm trying to create a link on my page to download a file.  However,
> > the server won't let me use mod_rewrite, and I'm having problems
> > getting the download to work.  I googled the problem, and made some
> > progress.
>
> > So far, I have:
>
> > In the view, the link to download the file is:
>
> >    <?php echo $this->Html->link('Download File', '/downloads/
> > download', array('class' => 'bluelink'));?>
>
> > I have a controller called downloads_controller.php which contains:
>
> > <?php
> > class DownloadsController extends AppController {
>
> >  function download () {
> >  $this->view = 'Media';
> >  $params = array(
> >   'id' => 'constition.pdf', // hard-coded for now
> >   'name' => 'constitution',
> >   'download' => true,
> >   'extension' => 'pdf',
> >   'path' => APP . 'files' . DS
> >  );
> >  $this->set($params);
> >  }
> > }
>
> > The file is in the directory 'app/files'.
>
> > When I click on the link in the view I get:
>
> >     Not Found
>
> >     Error: The requested address '/downloads/download' was not found
> > on this server.
>
> > Does anyone have any ideas as to what else I should be doing?
>
> Set debug to 2 in core.php. Cake throws a 404 when it encounters an
> error and is in production mode.

Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions.

You received this message because you are subscribed to the Google Groups "CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en

Re: How to use Grant in Shell ?

> I don't know. Do you mean the table's data ?
>
> I'm following the tutorial here
>
> http://book.cakephp.org/view/1550/Setting-up-permissions
>
> it says to allow permission for aro and aco tables..
>
> how to enable the permission ?

Here's an example 'installation' controller: http://pastie.org/1419477

it will do 3 things in the order required:

1. populate the aco table with a record for every public controller method.
2. create the user groups
3. set the permissions for the groups

1 you can leave as it is
2 you might need to change, depends how complex your app is (I would
suggest starting simple until you grasp the fundamentals)
3 you'll definitely need to change to match your requirements.

hth

Jon
ps: don't forget to disable the actions when you deploy to live!

--
jon bennett - www.jben.net - blog.jben.net

Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions.

You received this message because you are subscribed to the Google Groups "CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en

Re: a small issue

thanks amit... i got it right this time.......
echo $this->Html->link($this->Html-
>image('logout.png',array('alt'=>'logout'))
,array('controller'=>'users','action'=>'logout'),array('escape'
=> false));

i had mis placed the array('escape' => false) previously...

On Dec 31, 2:57 pm, poor-grammar <onlyprit...@gmail.com> wrote:
> <?php
>                        echo $this->Html->link($this->Html->image('logout.png',array('alt'=>'logout'),array('escape' => false))
>
>                                ,array('controller'=>'users','action'=>'logout'));
>                        ?>
>
> i did this.... still getting the same result <img src="/hr/img/
> logout.png" alt="logout" />
>
> i tried.
> hr is my project folder. i created a folder img in hr folder and
> dropped the image there.... but the image is not showing...
>
> $this->Html->css('hr'); this is working ok then why is $this->Html->image('image_nam.png') not working....
>
> i am working with the default lay out... does that make any
> difference?

Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions.

You received this message because you are subscribed to the Google Groups "CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en

Re: a small issue

<?php
echo $this->Html->link($this->Html-
>image('logout.png',array('alt'=>'logout'),array('escape' => false))
,array('controller'=>'users','action'=>'logout'));
?>

i did this.... still getting the same result <img src="/hr/img/
logout.png" alt="logout" />

i tried.
hr is my project folder. i created a folder img in hr folder and
dropped the image there.... but the image is not showing...

$this->Html->css('hr'); this is working ok then why is $this->Html-
>image('image_nam.png') not working....
i am working with the default lay out... does that make any
difference?

Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions.

You received this message because you are subscribed to the Google Groups "CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en

Re: a small issue

Hi,

You need to tell link() method to NOT escape the title, please have a look at http://book.cakephp.org/view/1442/link for more help, though you can use the following code as it is.

echo $this->Html->link($this->Html->image('logout.png',array('alt'=>'logout')),array('controller'=>'users','action'=>'logout'), array('escape' => false));

Amit Badkas

PHP Applications for E-Biz: http://www.sanisoft.com



On Fri, Dec 31, 2010 at 3:05 PM, poor-grammar <onlyprithvi@gmail.com> wrote:
 echo $this->Html->link($this->Html-
>image('logout.png',array('alt'=>'logout'))
                              ,array('controller'=>'users','action'=>'logout'));

$this->Html->image('logout.png',array('alt'=>'logout')--> this line is
giving me html source
 <img src="/hr/img/logout.png" alt="logout" />..
 and i think it sould give me this html <img src="/hr/webroot/img/
logout.png" alt="logout" />..

am i missing any thing?

Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions.

You received this message because you are subscribed to the Google Groups "CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en

Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions.
 
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en

a small issue

echo $this->Html->link($this->Html-
>image('logout.png',array('alt'=>'logout'))
,array('controller'=>'users','action'=>'logout'));

$this->Html->image('logout.png',array('alt'=>'logout')--> this line is
giving me html source
<img src="/hr/img/logout.png" alt="logout" />..
and i think it sould give me this html <img src="/hr/webroot/img/
logout.png" alt="logout" />..

am i missing any thing?

Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions.

You received this message because you are subscribed to the Google Groups "CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en

Re: How to use Grant in Shell ?

Hi,

Try the command by replacing $aroAlias (this should be any record's value in aros table for alias field) and $acoAlias (this should be any record's value in acos table for alias field) with their proper values.

Hope this helps.

Amit Badkas

PHP Applications for E-Biz: http://www.sanisoft.com



On Fri, Dec 31, 2010 at 12:42 PM, John Maxim <googol6@gmail.com> wrote:
I don't know. Do you mean the table's data ?

I'm following the tutorial here

http://book.cakephp.org/view/1550/Setting-up-permissions

it says to allow permission for aro and aco tables..

how to enable the permission ?

rgrds,
maxim
On Dec 31, 2:32 pm, Amit Badkas <amit.sanis...@gmail.com> wrote:
> Hi,
>
> What are the actual values of $aroAlias and $acoAlias variables?
>
> Amit Badkas
>
> PHP Applications for E-Biz:http://www.sanisoft.com
>
> On Fri, Dec 31, 2010 at 11:47 AM, John Maxim <goog...@gmail.com> wrote:
> > I have tried:
>
> > >cake acl grant $aroAlias $acoAlias
> > ---
> > Error: Wrong number of parameters
> > Got: 2
> > Expected: 3
> > Please type `cake acl help` for help
> > on usage of the AclShell grant.
>
> > ---
>
> > >cake acl grant $aroAlias $acoAlias all
> > --
> > PHP Warning:  DbAcl::allow() - Invalid node in C:\wamp\www\cakephp\cake
> > \libs\controller\components\acl.php on line 361
>
> > Warning: DbAcl::allow() - Invalid node in C:\wamp\www\cakephp\cake\libs
> > \controller\components\acl.php on line 361
> > Permission was not granted.
>
> > --
>
> > I think the problem is I just saw it. My cake console core path is at:
>
> > www/cakephp
>
> > How can I change to /www
>
> > ?
>
> > My work and app path is both at /www
>
> > Or is there something wrong with my grant command line ?
>
> > Regards,
> > Maxim
>
> > Check out the new CakePHP Questions sitehttp://cakeqs.organd help others
> > with their CakePHP related questions.
>
> > You received this message because you are subscribed to the Google Groups
> > "CakePHP" group.
> > To post to this group, send email to cake-php@googlegroups.com
> > To unsubscribe from this group, send email to
> > cake-php+unsubscribe@googlegroups.com<cake-php%2Bunsubscribe@googlegroups.com>For more options, visit this group at
> >http://groups.google.com/group/cake-php?hl=en

Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions.

You received this message because you are subscribed to the Google Groups "CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en

Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions.
 
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en