I am using CodeIgniter rest Controller. I want to be able to serve images on GET requests made by the client.
Is this the best option or should i just provide a link to
I think You could show the images to client and give them a check-boxes to download the images as a Zip file.
See this
To make CodeIgniter set the proper headers and such you could do this in your controller:
$this->output->set_content_type('jpeg')->set_output(file_get_contents('path_to_file'));
And it will output (as request response) the image content as a file. No view required.
Please note though that this is a bit of extra overhead as the file is processed by PHP instead of just the webserver (Apache/Nginx). It only makes sense if you need to have some business logic on the request, such as logging or authorization (though even that can be done without PHP). If you are just outputing the image it is therefor better to link straight to file and leave PHP out of it.