Monday, November 08, 2010 at 12:05 AM.
system.verbs.builtins.radio.weblog.oldStuff.uploadFile
on uploadFile (adrblog, fname, filetext, adrconnection = nil) {
<<Changes:
<<2/22/01; 5:06:56 PM by JES
<<If adrconnection is passed in, use that FTP session, instead of opening and closing one here.
<<2/23/01; 3:47:25 PM by JES
<<Open FTP connections with flMessages set to false.
local (flKeepConnectionOpen = false);
if adrconnection != nil {
flKeepConnectionOpen = true};
with adrblog^.prefs.ftp {
if not flKeepConnectionOpen {
adrconnection = tcp.ftp.openConnection (server, username, password, false)};
tcp.ftp.writefile (adrconnection, filetext, path + fname);
if not flKeepConnectionOpen {
tcp.ftp.closeConnection (adrconnection)}}}
<<bundle //test code
<<uploadFile (@myuserlanddata.blogs.default, "randomTestFile.txt", clock.now ())
This listing is for code that runs in the OPML Editor environment. I created these listings because I wanted the search engines to index it, so that when I want to look up something in my codebase I don't have to use the much slower search functionality in my object database. Dave Winer.