Como implementar FileToBlob, BlobToFile y visualizar el archivo ?

Consultas, trucos, consejos. Todo sobre Clarion en todas sus versiones
Responder
CWeidl
Novato
Mensajes: 47
Registrado: Mié Abr 16, 2014 8:23 pm
Ubicación: Buenos Aires - Argentina
Contactar:

Como implementar FileToBlob, BlobToFile y visualizar el archivo ?

Mensaje por CWeidl » Lun Jul 20, 2020 7:03 pm

Buenas tardes a todos.
Como se debe implementar (6.3+TPS) FileToBlob (para grabar el pdf en el campo BLOB), BlobToFile (para extraer el archivo) y despues visualizarlo ?
Desde ya les agradezco cualquier ayuda, ya que no encontre nada en las guias pdf de Clarion.
Saludos a todos


HDMadeira
Al nivel de RZ
Mensajes: 306
Registrado: Dom Feb 06, 2011 10:02 pm
Ubicación: Trelew, Chubut, Argentina
Contactar:

Re: Como implementar FileToBlob, BlobToFile y visualizar el archivo ?

Mensaje por HDMadeira » Mar Jul 21, 2020 2:06 am

Hola, creo que en el ejemplo invoice que viene con clarion, esta implementado

igualmente del help de clarion 11.. pero seguramente era igual en 6.x


BLOBTOFILE
Copy the contents of a BLOB field to an external file.

bloblabel
The fully qualified label of the BLOB field. (Example: Customer.BlobImage)

filename
A string constant or variable that names the output file where the BLOB will be copied.




BLOBTOFILE is used to copy the contents of a BLOB to an external file. If the copy fails for any reason, BLOBTOFILE returns the ERRORCODE posted.

BLOBTOFILE (and FILETOBLOB) are simply binary-to-binary operations.



If you need to save images to a BLOB, and later restore them to an output file, the type of image should also be saved in the database (JPG, GIF, BMP, etc.). Using BLOBTOFILE to save to a different extension can produce unpredictable results.

To add this function to your existing applications, you need only include the CWUTIL.INC file in the Global Map section of your program:

INCLUDE('CWUTIL.INC'),ONCE

Return Data Type: SIGNED

Example:

IF BLOBTOFILE(CUS:ImageBlob, 'imagename.jpg') !returns an ERRORCODE if copy fails

MESSAGE('BLOB did not copy due to the following ERRORCODE: ' & ERRORCODE())

END



See Also:

FILETOBLOB

BLOB

Responder

¿Quién está conectado?

Usuarios navegando por este Foro: No hay usuarios registrados visitando el Foro y 9 invitados