Consulta:
Código PHP:
    $sql_anexos="SELECT * from ANEXOS_ECI where id_eci=4390";
    $res_anexos=sqlsrv_query($con,$sql_anexos); 
    Código PHP:
    while($f_anexos=sqlsrv_fetch_array($res_anexos))
    {   
    if ($f_anexos['tipo'] == "IMAGEN")
    {
        $anexo= $f_anexos['anexo'];
        echo $anexo;  
        $extension = "jpg";
        $tipo = "jpg";
        $nombre="imagen";
        
        header("Content-type: image/jpg");
        header("Content-Transfer-Encoding: Binary");
        header('Content-disposition: attachment; filename="'.$nombre.'.'.$extension.'"');
        $ruta = '/siec_mail/temp/';
        fopen($ruta.$nombre);
    } 
     
 




