First I have the following folder structure:
BookShop ----> Project Name
Now inside the 'images' folder I have a pic file named rr.jpg.
I have the following controller class 'UserController' where I have written the following function :
class UserController extends CI_Controller
public function __construct()
public function test()
In the views I have written the following within a php webpage which I named 'testing.php' :
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
$data = file_get_contents(base_url().'/images/rr.jpg'); // Read the file's contents
$name = 'rr.jpg';
Now in the routes which is within the config folder I have written the following :
Now when I am executing the file,the file is getting downloaded but its not showing the picture within the file.When I am opening it with Fax-Viewer its saying "No preview available" why?.The above code in views, I got from internet.
If anybody can help....thank u. Sandip Ray.