Image attachment control in list view


Badge +3

Hi all,

 

i want to attach image for my item list view.

I set my property of item image to "Image" in smartobject.

When save, the image will be saved to database as <file><name>___</name><content>___</content></file>.

After i save, the list will be refreshed and the image cannot be load properly.

 

This is what i want to display in list view.

12313i06E05D7005B9288B.gif

 

Another ways is i set the property of item image to "memo" datatype.

The save value is the xml link of k2 temporary files path.

 i had tried, if the control in the list is image file control and the return path is xml link of k2 temporary file path, the image will be shown properly.

When everytime i change the property of item image to "memo", the control in list will be changed to memo.

 

Any idea how to make this thing work?

 

Thanks & Regards,

Kyo

 


3 replies

Userlevel 5
Badge +16

Hi Kyo,

 

Make sure that the field of the image in your Database is type of nvarchar(max) 

 

 

Generate editable list 

 

 ***UPDATE

 

If you already have configured this and still have the same issue, then I think you have permission issue on  File.ashx 

 

How to solve this:

 

go to C:Program Files (x86)K2 blackpearlK2 SmartForms RuntimeRuntime

 

right click on File.ashx > Properties > Security > Edit > Add,  give the domain users Read and Read & execute permission

 

 

 

wish it helps

Badge +3

Hi Mustafa,

 

Yes. I already set the property of image in database to nvarchar(max) and "image" in smartobject.

I check for the permission of files folder in runtime, already provide permission for read & read and execute.

 

Actually for file attachment it works if save into database as nvarchar(max) and "file" in smartobject.

But do not know why for image, it does not work.

 

I try to change the property of image to "memo" type in smartobject.

i have to store the image file path (k2 temporary folder path) in database and return it to a image attachment control, and this will work.

But in list view, whenever i change the property of image from "image" to "memo", the list will become memo type after editing.

 

So i am thinking is it other way for me to transfer the data of column "memo" to another column that is image attachment control in listview.

 

Thanks & Regards,

Kyo.

Hi Kyo, Not sure if you have found your solution.

But this is another option for showing images that were stored in SmartBox. This will work even if your image datatype is "memo" as in your case.

https://how2k2.wordpress.com/2017/02/22/displaying-full-res-images-in-a-list-view/

 

Reply