Providing image to <a href="??"></a> from database

Hi,
I was trying to create a ‘href’ to an image from my database using servoy_blobloader,

'<a href="media:///servoy_blobloader?servername=<myserver>&tablename=fancyboximages&dataprovider=images&rowid=1"><img src="media:///servoy_blobloader?servername=<myserver>&tablename=fancyboximages&dataprovider=images&rowid=1"/></a>'

which is showing the byte array as the output while in ‘src’ it is working fine.And if i pass a media directly into the ‘href’, like

<a href="media:///xyz.jpg"><img src="media:///servoy_blobloader?servername=<myserver>&tablename=fancyboximages&dataprovider=images&rowid=1"/></a>

it is also working.

Instead , i have tried fetching the image from database and storing it in a temporary file then passing the file path in the ‘href’ but the output is ‘cannot show the image’(jquery error message).

Please suggest me a way to pass a image media from database as a reference.

I am new in servoy so please attach code snippet so that i can get a better idea… :)

Thanks in advance
Sovan

The blob loader returns a byte array of the image so it doesn’t make sense to put that in the href property which expects a string representing the path to a file on the web server.

Temp files cannot be accessed by web servers generally as they are typically stored in a hidden directory of the operating system in question. You need to explicitly save the file to a location in Servoy’s tomcat directory to be available to web clients as a valid href link.

Hi david,

Thanks a lot. it worked… :)