AMIT Posted July 23, 2011 Share Posted July 23, 2011 Is there any method that I can get the Server URL? For example, my site url is 'http://Localhost:8077', I need to know if there is a method that return result to me as 'http://Localhost:8077'; Thank in advance. Quote Link to comment Share on other sites More sharing options...
patmap Posted July 23, 2011 Share Posted July 23, 2011 Hi AMIT Use : UniApplication.UniSession.URLPath Best Regards Quote Link to comment Share on other sites More sharing options...
AMIT Posted July 23, 2011 Author Share Posted July 23, 2011 Hi AMIT Use : UniApplication.UniSession.URLPath Best Regards Thank you. By the way, I try to use per your suggestion but I get empty string instead. var URLRef: string; begin . . URLref:=uniApplication.UniSession.URLPath+'MYPDF.PDF'; uniLabel1.Caption:='<a href="'+URLRef+'" target=_blank>'+URLRef+'</a>'; Quote Link to comment Share on other sites More sharing options...
Administrators Farshad Mohajeri Posted July 23, 2011 Administrators Share Posted July 23, 2011 You can use: UniSession.Host 1 Quote Link to comment Share on other sites More sharing options...
AMIT Posted July 23, 2011 Author Share Posted July 23, 2011 I wonder while debugging the the URLRef is Empty. But on the browser the UniLabel1.Caption display 'MYPDF.PDF'. when I position mouse pointer on unilabel, the correct link ('http://localhost:8077/MYPDF.PDF') shown on the status bar. If I click on the link new window open and show MYPDF.PDF correctly. I don't understand while debugging the URLRef is empty. Anybody can tell me why? Thank in advance. Quote Link to comment Share on other sites More sharing options...
Administrators Farshad Mohajeri Posted July 23, 2011 Administrators Share Posted July 23, 2011 Because string staring by "/" is automatically converted to a valid URL by browser. Browser automatically adds the base url to /mypdf.pdf Quote Link to comment Share on other sites More sharing options...
AMIT Posted July 23, 2011 Author Share Posted July 23, 2011 Because string staring by "/" is automatically converted to a valid URL by browser. Browser automatically adds the base url to /mypdf.pdf Thank you for the explanantion. Quote Link to comment Share on other sites More sharing options...
adan200 Posted January 7, 2019 Share Posted January 7, 2019 I'm trying to get the url of my application. I use ISAPI and it works well in this way, MyURL := UniSession.Host + UniApplication.UniSession.URLPath; But my network administrator assigned me a different port, to the public ip. Please look at the graph, would there be a way to get the final URL? Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.