mos Posted November 28, 2017 Share Posted November 28, 2017 A customer has developed a small program that implements a protocol and that program needs to receive a full url to the a file in the cache folder... 'http://70.60.ZZZ.XXX:8077' + audioUrl where 'audioUrl' is the file to be downloaded from /cache/... code wise, I can build most of the URL with url := 'http'; if UniServerModule.SSLEnabled then url := url + 's'; {how to get the host part programatically?!?} url := url + ':' + intToStr(UniServerModule.Port); url := url + audioUrl; my worst case scenari is to have the user define this somewhere as an attribute which would used something like url := config.url + ':' + intToStr(UniServerModule.Port); url := url + audioUrl; where config.url is a function that reads a value from the database, but in the case of the above example would return http://70.60.ZZZ.XXX Is there some property that contains the host part of the url? Thanks. Link to comment Share on other sites More sharing options...
RobYost Posted November 28, 2017 Share Posted November 28, 2017 If I understand the problem correctly: UniSession.URL Will return: http://123.123.123.123:8077 or http://123.123.123.123:8077/m if you need all parameters // ============================================================================= function rtnAllParms(): String; var i: Integer; p: String; begin for i := 0 to UniApplication.Parameters.count - 1 do begin if (i = 0) then p := p + '?' else p := p + '&'; p := p + UniApplication.Parameters[i]; end; result := p; end; Link to comment Share on other sites More sharing options...
mos Posted November 28, 2017 Author Share Posted November 28, 2017 Thanks. That worked perfectly! Link to comment Share on other sites More sharing options...
Alessandro Posted February 15, 2018 Share Posted February 15, 2018 Thanks. That worked perfectly! Hello! Did you make it? Can you give me an example with fonts? Thank you. Link to comment Share on other sites More sharing options...
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now