I am using a OLE Object container that uses a TiffViewer Control and a Microsoft Web Browser control to display JPG/TIF/PDF/Web Pages in my PowerBuilder 12.5 classic application.
The new requirement is to use "authenticated user credentials" while viewing these images since not all of my application users have access to the location of these images due to security reasons.
Is there an easy way to achieve this? Here is my current code to display images.
// For TIF/ JPGs
Praveen
my solution is working with the webbrowser control. I don't know if its working with Tiffviewer.
I assume you get the file from a webserver by a http(s) request and you need to specify credentials for the request using basic authentication. This is not working if you want to load the files from a network drive where you need to login!
You may try this https://social.msdn.microsoft.com/Forums/en-US/2810c0b5-a0db-49a4-a35e-bc7da0df49ac/webbrowser-control-auto-login?forum=csharplanguage
My solution is to do a request to an url (may be a url only for this thing) that needs the same credentials. I use for this Msxml2.XMLHTTP or Msxml2.ServerXMLHTTP ActiveX. You may specify the credentials in header or in the open function. Because the browser caches the credentials you may request the url after that in the browser control without credentials. Maybe it is easier to load the file you want to view directly using the XML ActiveX, save it to a local temp file and show the local file? This should work with the Webbrowser and Tiffviewer.
HTH