Download PDF file from blob

Hello…
There are some sample to download a pdf from a blob field, in my database?
Thanks!!!

SOLVED!

// Comprobante: Blob Binary field with PDF inside.
// NombreArchivo: Filename to the downloaded file.

sc_lookup(rs1,“Select Comprobante, NombreArchivo From Comprobantes Where Cod_Registro = " . [Cod_RegistroPar]. " AND Tipo = '”.[TipoCptePar]."’");
if(count({rs1}) <> 0) {
$filenombre = {rs1[0][1]};
$ubot = {rs1[0][0]} ;// there is a file of that name there!
header(‘Content-type: application/pdf’);
header(“Cache-Control: no-cache”);
header(“Pragma: no-cache”);
header(“Content-Disposition: inline;filename=’”.$filenombre."’");
header("Content-length: ".strlen($ubot));
echo $ubot;
exit();
}

1 Like

It`s wonderfull.
How can I applied it to download multiple files?

Thanks in advance

Hello…
yes, if your replace if(count({rs1}) <> 0) { for a “for each…” , you can download multiple files…
Try…
Thanks!