As Russ mentions, *if* you have access to the file from the CF server (which 
you would need in order for the 'FileExists' function to work), then you could 
use a 
<cffile action="copy"...... to get a copy of the file.  If you don't have 
direct access to it, then you need to figure out "how" you can access it.  If 
you can get to it 
via http, then use a <cfhttp> tag.  If you can get to it via FTP use a <cfftp> 
tag.  You may need to alter your method for determining if the file exists 
though.  If 
you need to use HTTP or FTP, then you can always try to get the file and if you 
get an error, handle it appropriately (ex. the file isn't there, etc).

Regards,
Michael L Gueterman
Integrated Information Systems, Inc.
--

-----Original Message-----
From: Russ Michaels <r...@michaels.me.uk>
To: cf-talk <cf-talk@houseoffusion.com>
Date: Tue, 1 Apr 2014 10:37:37 +0100
Subject: Re: how to check if a remote file exists

> 
> if you have direct access tot he server with the file then you would
> use
> CFFILE to copy it.
> If the file is only accessible over the web, then you can use CFHTTP to
> grab the file content and save to your local server. You will of course
> not
> get the raw file, only what is displayed in a browser.
> 
> 
> 
> On Tue, Apr 1, 2014 at 9:50 AM, safo 2000 <safokas...@hotmail.com>
> wrote:
> 
> >
> > i am a bit confused, this is the first time I do this kind of request
> so
> > bear with me.
> >
> > I am trying to do the following:
> >
> > i created a cf app on the source server (w2k3)
> >
> > <cfquery name="Param" datasource="lib_datasql" >
> >         SELECT proxloc from MainServer
> > </cfquery>
> > <cfset
> >
> fname="#param.proxloc#\@conv_#dateformat(dateadd("d",-1,now()),'dd-mm-y
> yyy')#.txt">
> >
> > <cfif FileExists("#fname#") >
> >
> >         (the above will check for the file and find it)
> >
> >         then i need to copy the file to the cf server and work with
> it,
> > that's were you lost me.
> > <cfelse>
> >         not found
> > </cfif>
> >
> >
> > > >ok, so then how would I do the copy from w2k3 to cf9 server
> > >
> > > You would use CFHTTP to grab the content from the other server, and
> > > then save it as a file on your CF9 server.
> > >
> > > Personally I would do a separate CF app, scheduled in the CF
> > > administrator, that would periodically look for the file on the
> other
> > > server, and if it is there, grab it and download it.
> > >
> > > Then when your aggregation app runs, it just has to worry about
> > > content on your server.
> > >
> > > YMMV of course - I'm looking at it from the perspective of an
> > > application I worked on where the other server wasn't that
> reliable,
> > > and separating the "grab files from the other server" and "process
> > > files" helped troubleshooting tremendously.
> >
> > 
> 
> 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:358268
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm

Reply via email to