from urllib import urlopen, urlencode from sys import argv url = "http://www.centralchurchyouth.org:8100/Photos/%s/manage_addProduct/Photo/manage_addPhoto" % argv[1] for filename in argv[2:]: args = {} args['file'] = open(filename).read() args['id'] = filename args['title'] = filename args = urlencode(args) urlopen(url, args) print filename