James F responded with some advice that worked...

...

rewrite it like this.

$html->link($html->image('/uploads/main_demo.jpg'), $html->url('/
uploads/main_zoom.jpg'), array('title' => 'hello', 'escape' =>
false, 'class' => 'mg_main'));

you shouldn't pass the url as an array. you can pass an array as a
parameter for $html->url to use verbose linking (i.e.
'controller'=>'post', 'action'=>'index').

On May 18, 4:53 pm, justclint <justcl...@gmail.com> wrote:
> Are you placing the folder "upload" somewhere in the webroot folder?
>
> If not, you would want to create your upload folder in the webroot
> folder. If they are images getting uploaded you might make a folder
> structure like:
>
> webroot/img/photos/mediagallery/uploads/
>
> Then your image helper would look something like:
>
> $html->link($html->image('photos/mediagallery/uploads/main_demo.jpg'),
> array($html->url('
> photos/mediagallery/uploads/main_zoom.jpg')), array('title' =>
> 'hello', 'escape' =>
> false, 'class' => 'mg_main'));
>
> Hope this helps.
>
> On May 18, 12:50 pm, foldiman <vi...@vinceallen.com> wrote:
>
> > I'm stuck trying to construct a URL using the html helper that points
> > to an jpeg sitting in an 'uploads' folder in my webroot folder. I've
> > tried the following.
>
> > $html->link($html->image('/uploads/main_demo.jpg'), array($html->url('/
> > uploads/main_zoom.jpg', true)), array('title' => 'hello', 'escape' =>
> > false, 'class' => 'mg_main'));
>
> > However, this creates the following URL which is obviously broken.
>
> >http://mysite/photos/mediagallery/http://mysite/uploads/main_zoom.jpg
>
> > When I remove the 'true' option from the $html->url statement I get
> > this which is also wrong.
>
> >http://mysite/photos/mediagallery/uploads/main_zoom.jpg
>
> > And then I also noticed that when I go to the following url, Cake asks
> > for a controller which is of course missing.
>
> >http://mysite/uploads/main_zoom.jpg
>
> > So how can I just point the browser to this image?
--~--~---------~--~----~------------~-------~--~----~
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+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to