I am just begining in python and pys60 and I'm not a programmer, so excuse the quality of the code, it's still WIP so some of it is not used gui etc. I hope you get the idea and it may prove useful to someone as a concept. I tried making a sis of this, but so far it doesnt run and shows no error (installed to same drive etc.), but the script does run thought the shell.

I don't have bluetooth and I don't have the nokia suite installed but I want to send files to the C drive of the phone. I set up an ftp server on my pc using "quick'n easy ftp" in my case.

The script gets the URL for the folder I want to copy to the phone if anything has changed it since it last got the URL itdownloads the whole folder to the phones python folder.

At the moment it loops forever, eventually my plan was to have it run in the background. So when I save my .py files on my pc they are uploaded to the python folder so I can run them from the shell "run script"

I'm sure someone could write this better or use the concept to do something more useful



Code:
import urllib
from appuifw import *
import e32
import audio

#exitcode not tested
running = 1
def quit():
    global running
    running = 0

timer = e32.Ao_timer()

app.exit_key_handler=quit
app.title = u"FTP GETTER"
app.screen = 'full'

oldftplist = "" #blank list so always download

while running:
    #ftpserver
    url = "ftp://a:a@192.168.1.67/"

    #ftp list from server
    ftplist = urllib.urlopen(url).read()
    if ftplist != oldftplist :
        #download path
        audio.say("uploaded")
        filedest = "c:\\data\\python\\"
        #print ftplist
        # split the output of the ftp list into many strings seperated by whitespaces
        eachfile = ftplist.split()
        # go thorugh each string and find all that contain a "." use these as filenames
        for x in eachfile:
            #print x
            if x.find(".") != -1 :
                print "Downloading "+x+" to "+ filedest
                urllib.urlretrieve(url+x,filedest+x)
    oldftplist = ftplist
    timer.after(1) #sleep for 1 seconds