HTML5 Data Bindings Support Product Page

Not a problem

Cannot Echo Image

Reported 10 years ago
1
has this problem
10 years ago Julio C posted:
Hello Teodor,
I am trying to echo an image I saved in the database, but I am not getting the image on the webpage. The databinding for the image is {{ClientPhoto}}. Could you please tell me what I am doing wrong with the code below:

<th width="153" rowspan="4" scope="col"><img src="{{ClientPhoto}}" alt="" width="270" height="244" data-binding-src="{{ClientPhoto}}"/></th>

Replies

Replied 10 years ago
10 years ago Teodor Kuduschiev replied:
Hello Julio,
The {{ClientPhoto}} binding returns what is stored in your database, for example: image_name.jpg
But if your image is located into a subfolder and this is not stored in the database you need to add it manually, like:
data-binding-src="folder_name/{{ClientPhoto}}"
Replied 10 years ago
10 years ago Julio C replied:
It is not returning anything (under search field "Jane" or "John" ) -> behaviormanagementsystem.com/clientmedsmgmt.php
The database has the image. What do you think I am doing wrong?
Replied 10 years ago
10 years ago Teodor Kuduschiev replied:
Sorry but i don't see a dynamic image on this page..
Replied 10 years ago
10 years ago Julio C replied:
That's the point. The image is in the database but the script is returning " " instead of the image.
Replied 10 years ago
10 years ago Teodor Kuduschiev replied:
What exactly is stored in your database as a client photo? Your data source returns this: "ClientPhoto":null
behaviormanagementsystem.com/dmxDatabaseSources/ClientInfoDataSource.php?search=j&limit=25&callback=jQuery111105120912830966744_1408615487276&_=1408615487286
Replied 10 years ago
10 years ago Julio C replied:
I made Jpeg graphics as test photos and stored them as mediumblob.
The phpMyAdmin shows all the images when I browse the data, and when I click on the images the browser shows the images with full descriptions including image size.

But you are right. When I do "test source" with DMXzone databindings, I get "null" for image. I do not know where the misconfiguration could be.
Replied 10 years ago
10 years ago Teodor Kuduschiev replied:
What exactly is the type of the field that stores your images?
Replied 10 years ago
10 years ago Julio C replied:
type=mediumblob
null=no
default=none
Replied 10 years ago
10 years ago George Petrov replied:
Hi Julio,

You can not stare an image as blob in the database and just display it on a image tag.

You should just have the image on a folder on your server and store its filename in the database in a simple text filed.

Then it will work.

Greetings,
George
Replied 10 years ago
10 years ago Julio C replied:
Hi George,
The information needs to be contained in one single file, in this case, the database file, for security and privacy requirements. I cannot put the images on a folder. That's not an option.
Replied 10 years ago
10 years ago Julio C replied:
Hi George,
Is not possible with the DMXzone databindings script to do what I am trying to do?
Replied 10 years ago
10 years ago Teodor Kuduschiev replied:
Hello Julio,
As George explained in the last post - You should just have the image on a folder on your server and store its filename in the database in a simple text filed.
That's how usually people work with dynamic images actually. There are other ways to protect files/images on your server.
Replied 10 years ago
10 years ago Julio C replied:
Hello Teodor,
The user of the script would be average office personnel. When they have to delete a record, all information including the images must be deleted simultaneously. Thus, the need to have the images stored in the database. I understand clearly what you and George are saying, but I cannot use that approach. Any suggestions?
Replied 10 years ago
10 years ago Teodor Kuduschiev replied:
No, unfortunately this is the only way to use dynamic images.

Reply to this topic