Love Fuel?    Donate

FuelPHP Forums

Ask your question about FuelPHP in the appropriate forum, or help others by answering their questions.
Best way to display uploaded images
  • Image upload is working nicely, and Html::image() returns an img tag with a src URL like this: [url=http://localhost/index.php/www/files/foo.jpg]http://localhost/index.php/www/files/foo.jpg[/url] The path is correct, but, the problem is this is routed through index.php which doesn't know anything about a "www" controller, and I get a broken image. What is the preferred approach:
    a) Add controllers to handle images and uploaded files
    b) Mess with .htaccess to prevent routing to index.php
    c) Do something with routing? I am hoping there would be an easy solution for this common use-case in the framework itself, but any of the above are easy enough to do. Just wanted guidance on the best way. Thanks...
  • Normally you would exclude your public files from rewriting.
  • Thanks WW. I will update my .htaccess to exclude www/ and assets/ subdirectories.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

In this Discussion