Page 1 of 1
Invoke Windows App via Image Click
Posted: Thu Feb 20, 2020 12:29 pm
by James-S
We are developing an application where upon an image click we can open in a new tab in the browser to point to the same image (.jpg) on an HTTP server. It is being requested that clicking the image would link to a drawing (.dwg) file of the same image but invoke an application associated with the .dwg file type.
I am just learning JavaScript so curious if anyone knows how to do that after a click image in Profound?
Any help appreciated.
Re: Invoke Windows App via Image Click
Posted: Thu Feb 20, 2020 7:06 pm
by Scott Klement
What are you asking how to do?
Re: Invoke Windows App via Image Click
Posted: Thu Feb 20, 2020 8:57 pm
by James-S
Scott,
My apologies for not being clear. I will try to better explain.
The request is to have an image type widget on a screen (e.g. jpg). On the click event on that widget, to have it go out to a HTTP server and select a file of .dwg. The .dwg file opens within an associated Windows program (TrueView to be specific). I guess in what I can explain, something like what happens when you download a file in Windows and if it has an associated file type to a program, it opens in the program.
Hope that further explains what the goal is.
Re: Invoke Windows App via Image Click
Posted: Thu Feb 20, 2020 9:44 pm
by Scott Klement
So, it sounds like on the onclick event, you want to do:
Code: Select all
window.open("http://the-url-to-the-dwg-file");
as well as configure the browser to open the file correctly (if it doesn't already do that.)
Re: Invoke Windows App via Image Click
Posted: Thu Feb 20, 2020 10:52 pm
by James-S
Yes, I think we are in sync.
So, I am using the window.open() function and it is opening up the .jpg in a new tab. If I understand what you are saying, if using the .dwg in the window.open() and the browser has been configured to associate to the TrueView program, that would open the application and not another browser tab?
Did I state that correctly? Please pardon my ignorance on JavaScript and browser interactions. I am slowly learning this from as an OLD IBM green screen developer. :)
Re: Invoke Windows App via Image Click
Posted: Fri Feb 21, 2020 12:41 am
by Scott Klement
Its hard to say exactly, since I don't have any prior experience with .dwg files.
But, typically, if you try to open a file type that the browser doesn't itself know how to handle, it will fall back on the configuration for the various plugins or file type actions. If it still doesn't find anything, it'll just download it.
Part of this also depends on the HTTP server to give the proper media type for the file its downloading.
Anyway, it's really easy to try this and see what happens.