Create a download link for path that is in mysql

2

I have the following structure in the database:

reuniaoId   escolaId    usuarioId   dataReuniao tituloReuniao   pathReuniao
7   14  1   2016-01-13  AEQEQ   uploads/reuniao/ata_2016_2418530_2HK73386F.pdf

I need to create a download page for these files

I have the following html code that returns the table and in the download part I would need to create a link to download each file in the "pathReuniao" of <th> "download"

<table> 
            <tr>
             <th> Data </th> 
             <th> Titulo </th>
             <th> Download </th>    
             <th> Remover </th>
            </tr>

            <?php
                while($linha = mysqli_fetch_assoc($lista_amigo )) 
                {
            ?>

            <tr> 
             <td> <?php echo date("d/m/Y", strtotime ($linha["dataReuniao"])) ?> </td>  
             <td> <?php echo utf8_encode($linha["tituloReuniao"]) ?> </td>
             <td> <?php echo utf8_encode($linha["pathReuniao"]) ?> </td>
             <td> <a title="Desativar" href="excluirReuniao.php?codigo=<?php echo $linha["reuniaoId"] ?>"><i class="fa fa-times"></i></a></td>
            </tr>

        <?php
            }
        ?>
    
asked by anonymous 26.01.2016 / 18:15

1 answer

3

If the files whose path pathReunion points to are in apache, it is relatively easy to create a hyperlink:

 <td> <?php echo '<a href="http://seuservidor/'.utf8_encode($linha["pathReuniao"]).'">http://seuservidor/'.utf8_encode($linha["pathReuniao"]).'</a>'?> </td>
    
26.01.2016 / 18:23