How to pass variable into file path ini php

Viewed 45

I am trying to pass $namefile into a path download. how to do it?

public function download($namefile)
        {
            
            return $this->response->download("pathfile/[here]", null);
        }

i'm using label to download the file

<label>File <a href="/suratmasuk/download/<?= $surat['file']; ?>"><sup>Download</sup></a></label>
1 Answers

Are you trying to download a file using button? If yes, why don't you use <?php base_url()/[file location] ?> inside your button href?

Related