<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DZone Snippets: ftp code</title>
    <link>http://snippets.dzone.com/posts</link>
    <pubDate>Thu, 24 Jul 2008 04:46:25 GMT</pubDate>
    <description>DZone Snippets: ftp code</description>
    <item>
      <title>FTPS upload a file from Ruby using Curl command line</title>
      <link>http://snippets.dzone.com/posts/show/4801</link>
      <description>Yes, this is lame, but I didn't have much luck with Ruby libraries, so this is what I came up with.&lt;br /&gt;&lt;br /&gt;&lt;code&gt;&lt;br /&gt;`curl -k --ftp-ssl -3 -T#{path} -u#{FTP_USER}:#{FTP_PASS} #{FTP_HOST}`&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;-k forces the connection even if the cert looks bad&lt;br /&gt;-3 turns on SSLv3&lt;br /&gt;-T file to upload&lt;br /&gt;-u user:password</description>
      <pubDate>Tue, 20 Nov 2007 15:46:06 GMT</pubDate>
      <guid>http://snippets.dzone.com/posts/show/4801</guid>
      <author>timmorgan (Tim Morgan)</author>
    </item>
    <item>
      <title>FTP to get a file from within PHP</title>
      <link>http://snippets.dzone.com/posts/show/3619</link>
      <description>&lt;code&gt;&lt;br /&gt;$conn_id = ftp_connect("www.yoursite.com");&lt;br /&gt;$login_result = ftp_login($conn_id, "username", "password");&lt;br /&gt;&lt;br /&gt;if ((!$conn_id) || (!$login_result)) {&lt;br /&gt;echo "FTP connection has failed!";&lt;br /&gt;exit;&lt;br /&gt;} else {&lt;br /&gt;echo "Connected";&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;// get the file&lt;br /&gt;$local = fopen("local.txt","w");&lt;br /&gt;$result = ftp_fget($conn_id, $local,"httpdocs/trlog.txt", FTP_BINARY);&lt;br /&gt;&lt;br /&gt;// check upload status&lt;br /&gt;if (!$result) {&lt;br /&gt;echo "FTP download has failed!";&lt;br /&gt;} else {&lt;br /&gt;echo "Downloaded ";&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;// close the FTP stream&lt;br /&gt;ftp_close($conn_id);&lt;br /&gt;&lt;/code&gt;</description>
      <pubDate>Sat, 03 Mar 2007 04:32:08 GMT</pubDate>
      <guid>http://snippets.dzone.com/posts/show/3619</guid>
      <author>shantanuo (shantanu oak)</author>
    </item>
    <item>
      <title>ftp recipes</title>
      <link>http://snippets.dzone.com/posts/show/2703</link>
      <description>Recursively Transfer all files in certain directory&lt;br /&gt;&lt;code&gt;ncftpget -u &lt;username&gt; -p &lt;password&gt; -R ftp://ftp.microsoft.com/Files/&lt;/code&gt;</description>
      <pubDate>Sat, 23 Sep 2006 18:38:40 GMT</pubDate>
      <guid>http://snippets.dzone.com/posts/show/2703</guid>
      <author>nevadalife (nevada)</author>
    </item>
    <item>
      <title>Mouting Directories for vsftp</title>
      <link>http://snippets.dzone.com/posts/show/2701</link>
      <description>&lt;code&gt;mount --rbind /mnt/pub /home/pub&lt;/code&gt;&lt;br /&gt;* logs are located at /var/log/vsftpd.log and /var/log/xferlog &lt;br /&gt;</description>
      <pubDate>Sat, 23 Sep 2006 18:35:53 GMT</pubDate>
      <guid>http://snippets.dzone.com/posts/show/2701</guid>
      <author>nevadalife (nevada)</author>
    </item>
    <item>
      <title>Send a file using FTP</title>
      <link>http://snippets.dzone.com/posts/show/711</link>
      <description>&lt;code&gt;&lt;br /&gt;import ftplib&lt;br /&gt;s = ftplib.FTP('myserver.com','login','password') # Connect&lt;br /&gt;&lt;br /&gt;f = open('todo.txt','rb')                # file to send&lt;br /&gt;s.storbinary('STOR todo.txt', f)         # Send the file&lt;br /&gt;&lt;br /&gt;f.close()                                # Close file and FTP&lt;br /&gt;s.quit()&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;Taken (with some mod.) from &lt;a href=http://sebsauvage.net/python/snyppets/&gt;here&lt;/a&gt;</description>
      <pubDate>Thu, 15 Sep 2005 00:05:30 GMT</pubDate>
      <guid>http://snippets.dzone.com/posts/show/711</guid>
      <author>korakot (Korakot Chaovavanich)</author>
    </item>
  </channel>
</rss>
