I am creating a simple API that downloads files from third party CDN (cloud files). ColdFusion is currently receiving this file successfully, and the file is available for download using CF content and CFHeader and the person who has called the API
The problem I have is that these files are protected There are files, so I can not use the direct link of the CDN, and these files can be from 50 MB-5GB. Therefore, due to these two issues, when I can use CFHTPP from the CDN, and then do this
I think that as Coldfusion is acting like a central server where the file is getting from the CDN to the bits and passing it to the user, or this whole file Downloading in Memory and
Text "itemprop =" text ">
Cfhttp downloads the file using. There is no support to hide the URI and re-serve the end user without downloading the file for the CDN. .
Most end users will not be able to tell where the file is located if you use the HTTP 301 or 302 status code.
301 is a permanent redirection and 302 is a temporary redirect The difference is that some browser cache is 301 so that the user does not have to hit your server again if he requests the URI for the second time.
You just do this
& lt ; Cfheader status = "301" statostext = "permanently taken" /> or
& lt; Cfheader stats = "302" statostext = "moved temporarily" /> & Lt; Cfheader name = "location" value = "# cdn_ur / #" /> & Lt; Cfabort / & gt; You can also use cflocation, which uses a 302 by default, but can be created to use another status code by using the status code attribute .
Comments
Post a Comment