This content has been marked as final. Show 8 replies
You could do what you desire fairly easily with the <cfdirectory...>
tag. See the documentation for all the details.
Whether or not this will succeed will depend on how your ColdFusion
server is networked to this image server. If they can talk to each
other it should be possible, if they can not because of network
configuration/security then it will be much more difficult.
Make sure that the login name used by the coldfusion service has access to the directory in question.
Use the CFDIRECTORY tag to create your record set.
query the directory to check for the existence of records that where the file name contains the MLS number in question.
It sounds to me that the files exist on a different server than the one running the application. If so, CFDIRECTORY won't work. I think that the solution is to use CFHTTP.
Thanks to both of you for your quick replies. jdelineIt, you're right, the images reside on another server that isn't running ColdFusion so I will need to find a solution that doesnt involve CFDIRECTORY. Could you give me a brief rundown on the properties of CFHTTP and how I could use it for this particular problem? I'm not at all familiar with it. Thanks.
If so, CFDIRECTORY won't work. I think that the solution is to use CFHTTP.
CFDirectory can work just fine just as long that the user that the
ColdFusion service runs under has the correct permissions to read the
other server's resources. One just uses a basic UNC path in the
<cfdirectory...> tag. I.E. <cfdirectory
CFHTTP will only work if the other server is a web server that responds
to http requests. If it is just a kind of file server or something it
will not respond to the <cfhttp...> tag.
the images reside on another server that isn't running ColdFusion so I
will need to find a solution that doesnt involve CFDIRECTORY.
You can use cfdirectory on the coldFusion server just as long as you can
log into that server as the user under which the ColdFusion service is
running and then navigate to the images server though the file system.
Now the default ColdFusion user is "localSystem" on windows. And this
user would not normally have any permissions to resources not on the
local box. But if you can provide a user that does have the necessary
permissions then this kind of cross network access is quite easy to do.
Here is article on how to setup you ColdFusion service to run under a user account you specify. Running ColdFusion as a specific user.
Give the user account you run ColdFusion as rights to the image directory and you can access it with cfdirectory and cffile.
I use CFDIRECTORY on other servers just fine. As has been stated, the key is that the cf login username needs permissions on the remote directory.