Is there a way to detect the ip address of the server and if it's the production ip address, then create an application variable for an image directory that points to a remote directory (in this case, Amazon's S3 server), and if it's the dev ip address, then set the image directory to the local directory.
Try the GetHostAddress() function at http://www.cflib.org/udf.cfm?ID=446. If you can use server name, look into CGI variables. <cfoutput> CGI.SERVER_NAME=#CGI.SERVER_NAME##CGI.SERVER_PORT#<br /> CGI.HTTP_HOST=#CGI.HTTP_HOST#<br /> </cfoutput> <!--- show all available ---> <cfdump var="#CGI#" /> Code (markup):
I'm not sure that is what I need actually. I need a function that will get the ip address without passing in a domain name or anything like that.
Actually cgi.remote_addr is what you use to get the client (remote) ip address. Under IIS 6.0 and CF8 you can use this to get the IP Address that the client request came in on (ie. the server IP address) #cgi.local_addr# Hope this helps!