|
Mailing Lists
|
Home /
Groups /
ColdFusion Talk (CF-Talk)
How to access files on an ftp url that doesn't allow direct ftp access?
Author: Rick Faircloth
Short Link: http://www.houseoffusion.com/groups/cf-talk/thread.cfm/threadid:57470#312060
I'm in! Thanks, Justin!
I even managed to get in with FileZilla.
I can't believe those guys were telling me a direct FTP connection
wasn't possible. (It's not the first time I've gotten wrong info
from them, however)
Tomorrow's gonna' be a brighter day now! :o)
Thanks, again!
Rick
----- Excess quoted text cut - see Original Post for more -----
Author: Rick Faircloth
Short Link: http://www.houseoffusion.com/groups/cf-talk/thread.cfm/threadid:57470#312057
Thanks for the info, Justin!
I'll work on that and try to make it work.
Hopefully this will work...I hate to think that I might
have to download the data manually every day!
Rick
----- Excess quoted text cut - see Original Post for more -----
Author: Justin D. Scott
Short Link: http://www.houseoffusion.com/groups/cf-talk/thread.cfm/threadid:57470#312055
> What I have to do is click on a link in my email,
> which takes to to an web page that uses an ftp url
> (ftp://datalink.interealty.com/....)
MLXchange certainly allow direct access to their FTP server. I wrote a
routine that downloads IDX feeds daily and it's fully automated. I can't
send you the full code (you know, the whole copyright and work for hire
stuff) since it's owned by the client, but here are the pertinent parts (not
optimized since this is just a small chunk of a vast empire of code; watch
for line breaks)...
<cfscript>
// Set our variables.
variables.ftp_server = "datalink.interealty.com";
variables.ftp_username = "anonymous";
variables.ftp_password = "your@e-mail-address.com";
variables.ftp_folder = "/DataLinkOutput/yourPathHere/";
</cfscript>
<!--- Get a file list from the server. --->
<cfftp action="open" connection="datalink" server="#variables.ftp_server#"
username="#variables.ftp_username#" password="#variables.ftp_password#"
stoponerror="yes">
<cfftp action="listdir" connection="datalink" name="remoteFiles"
directory="#variables.ftp_folder#" stoponerror="yes">
<cfftp action="close" connection="datalink">
At this point you'll have a remoteFiles query which you can loop through to
either download the individual files with CFFTP, or, in our case, generate
an FTP script and pass it to a command-line FTP utility to handle the actual
file transfers (I found that to be more stable over time with the larger
files).
Once downloaded, unzip, import and enjoy. For anyone else interested in the
trials and tribulations of the MLS system we are talking about, I wrote a
short novel about it in my blog.
--
Justin Scott, http://www.tlson.com/
Author: Rick Faircloth
Short Link: http://www.houseoffusion.com/groups/cf-talk/thread.cfm/threadid:57470#312054
I know that's a strange question, but it seems appropriate.
I've got a data vendor that doesn't provide direct access
to their FTP site that I can access using a traditional FTP program.
I've tried and can't get in.
What I have to do is click on a link in my email, which takes to
to an web page that uses an ftp url (ftp://datalink.interealty.com/....)
I can open the site in Windows Explorer and drag-n-drop the files into
a folder or I can open the url in Firefox and use the download dialog to
get the files, which works much better that Explorer.
I've requested that the vendor allow me direct FTP access to my folder,
but they say they can't because the URL changes every day with the downloads.
That doesn't make sense to me, because the URL in the email and the URL that
shows up in the browser is always the same. The names of the files change,
because the name includes a timestamp as part of the name. They're still
saying they can't (probably more that they won't) set up FTP access. Maybe
there're something I'm not understanding.
Anyway...
I tried using cfhttp to get the html off that page and try to get access to
the files that way, but all I get is a "Connection Failed" message.
Does this make sense to anyone? Is there any way to get the links to the files
that are part of the code in the HTML page displayed in the browser when I visit
the FTP URL?
Rick
|
May 24, 2012
|
Latest Fusion Authority Articles
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||