如何将来自本地驱动器的映像放入cfdocument文件? [英] How to put an image from a local drive into a cfdocument file?

查看:200
本文介绍了如何将来自本地驱动器的映像放入cfdocument文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这会在浏览器中显示图片:

This will show me the image in a browser:

<cfset myImage=ImageNew("d:\UploadedDocuments\thumbnails\1487862_page_1.jpg")>
<cfimage source="#myImage#" action="writeToBrowser">

但是如果我在.pdf文件中使用相同的代码,它会生成一个小红色的x。这不可能吗?

But if I use the same code inside of a .pdf file, it generates a small red x. Is this not possible to do?

推荐答案

如果映像已经在驱动器上,则不需要CFIMAGE。您可以这样嵌入:

If the image is already on the drive you don't need CFIMAGE here. You can embed it like so:

<img src="file:///d:\mysite\images\myimage.jpg" width="50" height="60">

您也可以使用HTTP路径 - 将其存储在您的网络可访问的位置服务器通过实际或虚拟目录使用< img> 标签。

You could also use an HTTP Path to it as well - store it at a location accessible by your web server through real or virtual directories use the <img> tag like you normally would.

这则讯息在 cfdocument和SSL ,以及上的这篇补充文章使用cfdocument的文件系统应该可以帮助您排序。

This post on cfdocument and SSL and this suplimental post on using the file system with cfdocument should help you sort it out.

这篇关于如何将来自本地驱动器的映像放入cfdocument文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆