Identifying the location of a revlet

Bringing the internet highway into your project? Building FTP, HTTP, email, chat or other client solutions?

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
rijames84
Posts: 3
Joined: Thu Dec 10, 2009 11:58 pm

Identifying the location of a revlet

Post by rijames84 » Fri Dec 11, 2009 12:03 am

I have a revlet that needs to know its address on the internet. Is there a function or parameter that can be passed? Or can I call something to figure out the URL of the Revlet itself? I have a settings file that resides in the same folder as the revlet on the server, I want to read that file in. I don't need to write to the file, just read. I can use GET URL if I know the address.

Any help would be appreciated.

Richard

bn
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 4163
Joined: Sun Jan 07, 2007 9:12 pm

Re: Identifying the location of a revlet

Post by bn » Fri Dec 11, 2009 1:08 am

Hi Richard,
welcome to the forum.
If you want to read a prefs file from your server you already know the URL.
Lets assume your prefs file is in your public folder in a subfolder testfile in another subfolder presets and the name of the text file is prefs.txt then you can get it from your revlet like this:

Code: Select all

on mouseUp
   put "http://yourDomainName.com/testfile/presets/prefs.txt" into myPath
   put url myPath into field 1
   -- or
   put url myPath into myVariable
end mouseUp
regards
Bernd

rijames84
Posts: 3
Joined: Thu Dec 10, 2009 11:58 pm

Re: Identifying the location of a revlet

Post by rijames84 » Fri Dec 11, 2009 2:48 pm

Thanks Bernd,

I know my server's address, but this revlet is to deployed on customers webservers as a product and each deployment will be on a different server. I don't want to hard code each deployment's address in the revlet. Somehow I'd like to read in a file that gives me the URL of the server it is sitting on.

Hope that make better sense.

Richard

oliverk
Site Admin
Site Admin
Posts: 53
Joined: Mon Feb 27, 2006 2:16 pm

Re: Identifying the location of a revlet

Post by oliverk » Fri Dec 11, 2009 4:56 pm

Hi Richard,

If you know the address when you generate the HTML page that the revlet resides in, you could pass the url to it using the revletParams. There is a lesson on our site that explains how to do this:

http://lessons.runrev.com/spaces/lesson ... -a-plugin-

Hope this helps
Regards
Oliver
Oliver Kenyon
Software Developer
Runtime Revolution

rijames84
Posts: 3
Joined: Thu Dec 10, 2009 11:58 pm

Re: Identifying the location of a revlet

Post by rijames84 » Fri Dec 11, 2009 5:33 pm

Oliver,

Thank you so much. I was headed in the right direction, but the lesson was perfect help.

Richard

Post Reply