实现cf外挂
…posted by davidjmedlock:
…由 davidjmedlock 发布 :
Okay, this is a bit of an annoyance. I was writing an application for managing logos in a system where many clients log in. We’d get the client ID, retrieve the most recent logo and display it. The problem was, this system was written in ColdFusion, but had to be used in a .Net app, as well.
好吧,这有点烦人。 我正在编写一个用于在许多客户端登录的系统中管理徽标的应用程序。我们将获取客户端ID,检索最新的徽标并显示它。 问题是,该系统是用ColdFusion编写的,但也必须在.Net应用程序中使用。
No problem, I thought. I can use CFCONTENT to return this as an image and all they have to do is put the URL to the CF template path in their IMG SRC attribute, like this:
没问题,我想。 我可以使用CFCONTENT将其作为图像返回,而他们要做的就是将URL放入其IMG SRC属性中的CF模板路径,如下所示:
Then in the CF template, I’d do this:
然后在CF模板中,我将执行以下操作:
But, does this work in ColdFusion 5? No! Apparently CF 5 has some issues with its HTTP implementation. Whenever I did the tag in an actual application, it ended up not loading the image. When I went directly to that page, I just got a blank page.
但是,这在ColdFusion 5中有效吗? 没有! 显然,CF 5的HTTP实现存在一些问题。 每当我在实际应用程序中执行标记时,它最终都不会加载图像。 当我直接进入该页面时,我只有一个空白页面。
Now, I’ve talked with another developer that had attempted something vaguely similar to this before and had problems with CF handling HTTP. If I run this code:
现在,我与另一位开发人员进行了交谈,该开发人员之前曾尝试过类似的尝试,但是CF处理HTTP时遇到了问题。 如果我运行此代码:
gif.html:
gif.html:
returngif.cfm:
returngif.cfm:
It works okay. Now, I know some are going to say “Did the file that you were trying to return actually exist ?” Yes it did. I double, triple and quadruple checked that. I checked everything I could think of, making sure the file existed, that it was returning the correct MIME type, etc. etc. etc. Still no luck. Ah well, just one more query for the .Net guy to run…
还行吧 现在,我知道有人会说“您要返回的文件确实存在吗?” 是的,它确实。 我检查了两倍,三倍和四倍。 我检查了所有可以想到的内容,确保文件存在,返回的是正确的MIME类型等。等等。依旧没有运气。 嗯,只需再查询一个即可运行.Net的人……
BTW – I haven’t forgotten about the BlueDragon testing. I actually downloaded it and the installation guide. Unfortunately, you can’t have BlueDragon and ColdFusion installed on the same IIS server, so I’ll have to wait until I have time to uninstall/reinstall, etc. before I can test it. Also, they’re currently developing a .Net version of BlueDragon that will allow ColdFusion to integrate with .Net as it integrates with Java. Yay!
顺便说一句–我还没有忘记BlueDragon测试。 我实际上下载了它和安装指南。 不幸的是,您不能在同一IIS服务器上安装BlueDragon和ColdFusion,所以我必须等到有时间卸载/重新安装等之后才能进行测试。 此外,他们目前正在开发BlueDragon的.Net版本,当ColdFusion与Java集成时,它将使ColdFusion与.Net集成。 好极了!
‘Til next time, have fun!
直到下一次,玩得开心!
翻译自: https://www.sitepoint.com/http-implementation-sketchy-in-cf-5/
实现cf外挂
相关资源:cf外挂源码