Ask Your Question
0

how to download images stored in base LongVarBinary?

asked 2018-07-18 16:56:28 +0200

theone814 gravatar image

Hi, I have Images stored in LibreOffice Base in a table field LongVarBinary. I created a form where I can insert and delete images. Now I am keeping images there to use later. I want to add a download button to download the selected stored image. I searched online and I have yet to find anything useful on how to do that. Can Anyone help? Using default DB.

I know I can link the image rather than storing it in the DB but I want to keep it in the DB to make it easier for others. Is there a way to download the image?

edit retag flag offensive close merge delete

Comments

I created a Form Image Control where I can insert and remove image. When an image row is selected in the form, The image is viewed in "Image Control" field. I need to be able to download the image as well. I can't find a way on that field to download nor to create a download button for it.

theone814 gravatar imagetheone814 ( 2018-07-18 18:07:07 +0200 )edit

1 Answer

Sort by » oldest newest most voted
0

answered 2018-07-18 17:26:13 +0200

Ratslinger gravatar image

Hello,

It is not clear as to what is meant by ..download the selected stored image. If you want to use these images somewhere else, then that somewhere else needs access to you database. Data is only accessed through the database and that means needing a database connection or code to access Base. You most likely would need to use something other than an embedded database.

As for the default DB, this is a bad idea. The default Embedded HSQLDB is prone to problems when it comes to large amounts of data and images certainly fall into this category. Each time the Base file is opened or closed the files are zipped/unzipped from the .odb causing a potential loss of data. Have see failure with as few as 5-7 images in a file.

You would be much better off using Firebird (currently enabled with experimental features but soon to be the new default) which does not have this data loss problem. Other external databases also work - PostgreSQL, MySQL, etc.

edit flag offensive delete link more

Comments

I added a comment with more description about the use in form. Thanks for the heads up about the DB type. Do you know of a way to convert existing schema and forms to use new database?

theone814 gravatar imagetheone814 ( 2018-07-18 18:09:44 +0200 )edit

@theone814 Sorry, but the question remains the same. Download it to where? Seems you already have table & fields established where the image is one of them therefore the image is already in the DB. So please explain what you mean by download it.

As for different DB, it really depends upon which DB you want to change to. There are many and different reasons to use one over another.

Ratslinger gravatar imageRatslinger ( 2018-07-18 18:22:47 +0200 )edit

I suppose that OP wants to simply save the image from the DB to a separate image file using that button, which was called "download" :-)

Mike Kaganski gravatar imageMike Kaganski ( 2018-07-18 23:19:16 +0200 )edit

Thanks Mike - That is what I kind of guessed myself.

@theone814 - For downloading to a directory you need to use a macro (basic code). There is a sample, with code, at the end of this post -> Pictures in Base. It also refers to Pitonyak's original .odb & his excellent book on macros.

Ratslinger gravatar imageRatslinger ( 2018-07-19 00:07:00 +0200 )edit
Login/Signup to Answer

Question Tools

1 follower

Stats

Asked: 2018-07-18 16:56:28 +0200

Seen: 154 times

Last updated: Jul 18 '18