Club Delphi  
    FTP   CCD     Buscar   Trucos   Trabajo   Foros

Retroceder   Foros Club Delphi > Otros entornos y lenguajes > PHP
Registrarse FAQ Miembros Calendario Guía de estilo Buscar Temas de Hoy Marcar Foros Como Leídos

 
 
Herramientas Buscar en Tema Desplegado
  #5  
Antiguo 20-05-2005
asirvent asirvent is offline
Miembro
 
Registrado: may 2003
Posts: 48
Poder: 0
asirvent Va por buen camino
Para acabar, me vuelvo a responder yo mismo.

Para poder mostrar el fichero en pantalla correctamente, al final lo he tenido que guardar temporalmente y posteriormente cargarlo, me ha quedado así:

$dbh1 = ibase_pconnect ($cfgDbDatabase, $cfgServerUser, $cfgServerPassword);
$stmt1 = "select ap_pdf from albaran_pdf ";
$stmt1 = $stmt1."where em_codigo='1' and s_codigo='O' and a_codigo=14035";
$sth1 = ibase_query ($dbh1, $stmt1);
$row1 = ibase_fetch_object ($sth1);
$blob_data = ibase_blob_info($row1->AP_PDF);
$blob_hndl = ibase_blob_open($row1->AP_PDF);

$nombre_archivo = 'albaran.pdf';
$contenido = ibase_blob_get($blob_hndl, $blob_data[0]);

if (!$gestor = fopen($nombre_archivo, 'w+')) {
echo "No se puede abrir el archivo ($nombre_archivo)";
exit;
}

// Escribir $contenido a nuestro arcivo abierto.
if (fwrite($gestor, $contenido) === FALSE) {
echo "No se puede escribir al archivo ($nombre_archivo)";
exit;
}

fclose($gestor);
ibase_blob_close($blob_hndl);

$filepa='albaran.pdf';
header('Content-type: application/pdf');
header("Pragma: public");
header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
header('Content-Length: ' . filesize($filepa));
readfile ($filepa);

Con esto ya funciona correctamente.

un saludo
Responder Con Cita
 


Herramientas Buscar en Tema
Buscar en Tema:

Búsqueda Avanzada
Desplegado

Normas de Publicación
no Puedes crear nuevos temas
no Puedes responder a temas
no Puedes adjuntar archivos
no Puedes editar tus mensajes

El código vB está habilitado
Las caritas están habilitado
Código [IMG] está habilitado
Código HTML está deshabilitado
Saltar a Foro


La franja horaria es GMT +2. Ahora son las 23:08:17.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Traducción al castellano por el equipo de moderadores del Club Delphi
Copyright 1996-2007 Club Delphi