pywws.service.ftp

Upload files to a web server by FTP.

This module uploads files to (typically) a website via FTP. Details of the upload destination are stored in the file weather.ini in your data directory. You should be able to get the required information from your web space provider. If your provider allows SFTP then you could use pywws.service.sftp for greater security.

  • Example weather.ini configuration:

    [ftp]
    site = ftp.xxxx.yyyy.co.uk
    user = xxxxxxx
    password = zzzzzzzzz
    directory = public_html/weather/data/
    port = 21
    
    [hourly]
    plot = ['24hrs.png.xml', 'rose_12hrs.png.xml']
    text = ['24hrs.txt']
    services = [('ftp', '24hrs.txt', '24hrs.png', 'rose_12hrs.png')]
    

Run pywws.service.ftp once to set the default configuration, which you can then change. directory is the name of a directory in which all the uploaded files will be put. This will depend on the structure of your web site and the sort of host you use. port is the port number to use. 21 is the standard value but your web space provider may require a different port.

You can upload any files you like, as often as you like, but typical usage is to update a website once an hour. Each file to be uploaded needs to be listed in a service entry like ('ftp', 'filename'). If the file is not in your work directory’s output directory then filename should be the full path.

Classes

ToService(context[, check_params])


Comments or questions? Please subscribe to the pywws mailing list http://groups.google.com/group/pywws and let us know.