I want send the value via URL when i click a href tag and get the file(pdf/docs) from the database and how to fetch the file in the database.my default.php code :

<?php foreach($view_docs as $view_result) : ?>
                                $doc_id_value = $view_result->doc_id;
                                $loc_doc_name = array('1'=>'Education','2'=>'Certification','3'=>'Client Paperwork','4'=>'Invoice');
                                echo $loc_doc_name[$doc_id_value];
                            <td><?php echo $view_result->doc_id; ?></td>
                            <td><a href="<?php echo code is here ?>"><?php echo $view_result->name; ?></a></td>
                            <td><?php echo $view_result->created; ?></td>


                <?php endforeach; ?>

My Database Img is: enter image description here

default.php view: when i click the name field,the corresponding file to be downloaded enter image description here


The scope question is too wide for a simple answer.

When you click on a href tag, a controller receives the call. The controller can call the helper to retrieve the PDF Blob and return to the controller the binary object. And, finally the controller response returns the generated PDF output.

| improve this answer | |
  • now i got the current page url and add the value(Ex:url?doc_name=chap6.pdf).Thank your response – reegan29 Jun 23 '14 at 12:24

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.