Solved

Accessing files remotely

Posted on 2014-04-07
4
135 Views
Last Modified: 2014-04-08
I wasn't sure which TA to put this question into, but it involves reading files from ColdFusion.

Our salespeople often have to access our intranet when out on the road, and they need to be able to view files (pdfs)  These are accessed in the intranet by hyperlinks in the style of

<a href="\\appserver\files\filename" target="_blank">Filename</a>

The links work fine in-house, but not when accessed remotely.

How do I change the hrefs to  http links so they will work both in-house and remotely?

The intranet is accessed internally as http://appserver/intranet/default.cfm, but remotely as https://remote.xyz.com/intranet/default.cfm
0
Comment
Question by:jdthedj
  • 2
  • 2
4 Comments
 
LVL 4

Expert Comment

by:Rodrigo Munera
ID: 39984995
Make sure the links are relative and not full.

e.g. instead of the links being href="http://appserver/intranet/default.cfm", make them href="/intranet/default.cfm".

You will have to do this with all your links.
0
 
LVL 3

Author Comment

by:jdthedj
ID: 39985082
Thanks for the reply Rodrigo.  

I have tried your suggestion, but when I look in the status bar of IE it shows the url resolved to http://appserver/files/filename
0
 
LVL 4

Accepted Solution

by:
Rodrigo Munera earned 500 total points
ID: 39985739
Yeah, the browser will resolve the URL to the current domain when using relative href. That's why it will work for both urls.
If you view the page from http://appserver/ the client will resolve the urls to http://appserver/files/filename. If you view the pages as http://remote.appserver.org/ the urls will resolve as http://remote.appserver.org/files/filename in the status bar. The browser is smart enough to make that distinction.
0
 
LVL 3

Author Comment

by:jdthedj
ID: 39987527
Thanks Rodrigo.  You have pointed me to the right place.  I have discovered, but don't know why, CF can look down the folder tree, but not up it.  We've had to move the files within the tree to make things work, and then there's the headache of permissions.....
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Hi, I will be creating today a basic tutorial on how we can create a Mail Custom Function and use it where ever we want. The main advantage about creating a custom function is that we can accommodate a range of arguments to pass to the Function and …
Sometimes databases have MILLIONS of records and we need a way to quickly query that table to return the results me need. Sure you could use CFQUERY but it takes too long when there are millions of records. That is why SOLR was invented. Please …

856 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question