|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
Storing Images in PostgreSQL
i managed to store images uploaded in a MySQL database by using the field data type as 'longblob'.
However, when i use the same application on a PostgreSQL db environment, with the field( in which i store the binary data of an image) data type as 'text', and retrieve it, it does not appear...why is it so? btw, i point to a file called, say, showimage.php, in which is found the <img> tag, whose src attribute is pointing to another PHP file called, getimage.php?imgid=1. This is the file that retrieves the image binary data from database.
__________________
Beginner |
|
#2
|
|||
|
|||
|
oh yea, think i should be using the datatype 'bytea' for Postgres to store binary data. But it still doesn't work.
|
|
#3
|
|||
|
|||
|
To load and store images on postgresql, as documentation says (http://www.postgresql.org/files/documentation/books/aw_pgsql/node96.html#using_large_objects), you need use field type OID and functions "lo_import", "lo_export" and "lo_ulink" to store, retrieve and remove objects...
|
![]() |
| Viewing: Dev Articles Community Forums > Databases > General SQL Development > Storing Images in PostgreSQL |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|