Does Appgini support Blob storage of images?

If you're a new user of AppGini, feel free to ask general usage questions, or look for answers here.
Post Reply
Appgini_tester
Posts: 10
Joined: 2016-08-13 13:16

Does Appgini support Blob storage of images?

Post by Appgini_tester » 2016-08-22 18:09

Hi,

Are any of the options - Image or File Upload - able to store the binary content of a jpg or pdf in a Blog field?


Related to this, I can't seem to select File Upload, just to see what happens when it's generated. If you select File Upload, and click ok on the suggested file types, it Appgini re-selects Image.

Appgini_tester
Posts: 10
Joined: 2016-08-13 13:16

Re: Does Appgini support Blob storage of images?

Post by Appgini_tester » 2016-08-22 18:57

Ugh. The situation is even worse. Appgini won't let me exit.

My field is called Photo_Id. It's a long BLOB.

Image is selected. Appgini won't let me switch to either Link or File upload. It just keeps returning back to Image.

Further, when I try to Generate code, it keeps interrupting and saying that

in order for the field ...Photo_Id to be used as an image, it must have a data type of 'Char' or 'Varchar', etc.

Ok. I understand. But then why won't it let me de-select Image, so that I can generate the code and move on?

Even worse, if I try to leave things be, save it and exit without generating, it pops up that same error, and doesn't let me exit.

I'm willing to just go into the axp file, and manually change it to link. But since Appgini won't let me exit, that also is impossible unless I exit abnormally.


Post-note: Ok, it finally let me exit, if I respond with 'No' to the prompt about Saving without Generating.

grimblefritz
AppGini Super Hero
AppGini Super Hero
Posts: 336
Joined: 2015-12-23 16:52

Re: Does Appgini support Blob storage of images?

Post by grimblefritz » 2016-08-22 22:56

There is indeed a bug in the Windows app when trying to switch from image back to a link field. In fact, it is also problematic to switch from a lookup field to something else. Maybe Ahmad can address this problem in an upcoming release.

As to storing images in BLOB fields, you'd have to add a hook (code) for that. The built-in image and file upload options store the uploaded files in the /images folder. The field is the filename associated with the upload.

So, no, it doesn't store images in BLOBs. However, you could upload the image or file using the built-in tools, and then use the tablename_after_insert (or update) functions (in hooks/tablename.php) to read the image and stuff it into the BLOB field. As cleanup, you'd then want to null the field with the file ID as well as delete the file from the /images directory.

Appgini_tester
Posts: 10
Joined: 2016-08-13 13:16

Re: Does Appgini support Blob storage of images?

Post by Appgini_tester » 2016-08-23 13:07

Grim,

I didn't expect such a complete answer. Thanks for the suggestions and direction.

Post Reply