House of Fusion
Home of the ColdFusion Community

Search cf-talk

December 02, 2008

<<   <   Today   >   >>
Su Mo Tu We Th Fr Sa
   1 2 3 4 5 6
7 8 9 10 11 12 13
14 15 16 17 18 19 20
21 22 23 24 25 26 27
28 29 30 31       

Search over 2,500 ColdFusion resources here  >>>      
Home /  Groups /  ColdFusion Talk (CF-Talk)

How to access files on an ftp url that doesn't allow direct ftp access?

  << Previous Post |  RSS |  Sort Oldest First |  Sort Latest First |  Subscribe to this Group Next >> 
Thanks for the info, Justin!
Rick Faircloth
09/04/08 10:13 P
I'm in! Thanks, Justin!
Rick Faircloth
09/04/08 11:58 P
Top  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Rick Faircloth
09/04/2008 09:37 PM

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

Top  |   Parent  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Justin D. Scott
09/04/2008 09:53 PM

> 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/

Top  |   Parent  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Rick Faircloth
09/04/2008 10:13 PM

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 -----

Top  |   Parent  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Rick Faircloth
09/04/2008 11:58 PM

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 -----


<< Previous Thread Today's Threads Next Thread >>

Mailing Lists