Coldfusion 7 - Accessing images from a network share
So this morning I had an issue where in images were not being displayed. The images are stored on network share on a different machine.
I used this code to make it work, thanks to the help provided by http://www.acfug.org/ members.
welcome to the test page.....
<cfset theFile = "\\servername\sharename\CF_Chart_Share\test.jpg">
<cfif fileExists(theFile)>
File exists
<cfelse> does not exist
</cfif>
<br><cfoutput>#theFile#</cfoutput> <br>
<!--- we have code in img2.cfm that will get us the image -->
<br><img src="img2.cfm">
The file img2.cfm has the code below
<cfcontent type="image/GIF" file="\\servername\sharename\CF_Chart_Share\test.jpg">
I tried adding the code cfcontent in the same page but that was causing only the image to be displayed i.e. no text was being displayed.
Hope it helps someone.
Ajas.
I used this code to make it work, thanks to the help provided by http://www.acfug.org/ members.
welcome to the test page.....
<cfset theFile = "\\servername\sharename\CF_Chart_Share\test.jpg">
<cfif fileExists(theFile)>
File exists
<cfelse> does not exist
</cfif>
<br><cfoutput>#theFile#</cfoutput> <br>
<!--- we have code in img2.cfm that will get us the image -->
<br><img src="img2.cfm">
The file img2.cfm has the code below
<cfcontent type="image/GIF" file="\\servername\sharename\CF_Chart_Share\test.jpg">
I tried adding the code cfcontent in the same page but that was causing only the image to be displayed i.e. no text was being displayed.
Hope it helps someone.
Ajas.
Comments