Jump to content

How to open images in a new tab in the browser


Wade Zhao

Recommended Posts

I save the image file in some subdirectory, if I use this code

 UniSession.SendFile([exact path],[filename]);

Then browser's behavior is start to download it.

If I use this code

UniSession.AddJS('window.open('''+[image url]+'''',''_blank'');'')


I can get the browser to open in a new tab, that is what I want.

 

But my question is: how do I confirm this [image url]?

 

If I put my application‘s .exe file in the c:\app  and save the image file in the c:\app\image directory, the [image url] should be "\image\xxx.jpg", but if I compile my application as an ISAPI DLL, will the application still recognize which directory it is in?

 

Since what I want  is to click a button and perform different operations for different types of files, so I can't simply add a label with a link to achieve this goal.

Link to comment
Share on other sites

On 8/23/2021 at 10:19 AM, Wade Zhao said:

If I put my application‘s .exe file in the c:\app  and save the image file in the c:\app\image directory, the [image url] should be "\image\xxx.jpg", but if I compile my application as an ISAPI DLL, will the application still recognize which directory it is in?

Maybe you can use UniServerModule.ServerRoot to get the folder where you put the ISAPI DLL.

For example: UniServerModule.ServerRoot+'image\xxx.jpg'

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...