Can I use ColdFusion CFHTTP to retrieve source code from one or more target directories?

  Kiến thức lập trình

Can I use ColdFusion CFHTTP to retrieve source code from one or more target directories? I will give an example to help clarify. We have an in-house application server and applications that run on that server that use the page appearance taken from our central non-application Web server.

I use to retrieve the target source code from our central server before I parse and massage that code into a result we can integrate into our applications. Variables.StrPath is the variable we use for our target Web page(s) from which we retrieve our source code. With RESOLVEURL=“Yes” ColdFusion converts all reletave links to absolute links. This addresses much of our code-massaging needs.

There also is a source-code relative link— /content/mgt/jcr:content.nav.html —that requires a bit more effort in that converting that link to an absolute link results in a JavaScript Cross-Origin Request Blocked error, which I cannot resolve. My solution was to retrieve the source code for that file (jcr:content.nav.html) using CFHTTP, store it in a differently named file on our local Windows server, and then use a relative reference from our server to call that file content. I was able to use CFHTTP to retrieve the source code since the code resided in a single HTML file, and I could see the full path to that file in the original retrieved source code. Our situation recently changed.

The relative link in the above paragraph was replaced with this relative link—/content/mgt/config/headeru002D2024u002Dcf/jcr:content/root/header/topnav, which no longer points to a single file but appears to point to a directory. Am I able to use ColdFusion CFHTTP to retrieve source code from that entire directory? If so, how?

LEAVE A COMMENT