Question
· Sep 8, 2023

Viewing stored images

Hi Guys,

In my Zen page I've a grid with a list of uploaded images and it's working fine when running from the Server where the application resides where I can just click to an image and my code displays the image in a second screen (MSDS.Image.StreamServer.cls) ,

 

but the problem if running the page from a client machine (internet), I get this annoying extra steps with the file downloaded as .cls then I'll have to click open and choose a program ..etc which is inconvenient for user so how can I fix this?  

 

 

here is the call to view the image

<column linkCaption="View" header="ImageLink" link="MSDS.Image.StreamServer.cls?ATTID=#(%query.ID)#&amp;FILENAME=#(%query.FileName)#'" 
 

 

Thanks

Product version: Ensemble 2018.1
Discussion (1)1
Log in or sign up to continue

Make sure, that your class responses with correct HTTP header ContentType, so, browser will understand that it's an image, and if the content type is supported it will be shown, as well as ContentDisposition

for instance

Content-Type: image/jpeg
Content-Disposition: inline; filename="filename.jpg"

PNG, and other files, should have their own content types too