retrieving file data from an external server - where to start?
Lee Reilly CS1997
lreilly at cs.strath.ac.uk
Tue Feb 20 11:20:03 EST 2001
hi there,
i'm using python with zope and am trying to do the following with python
method:
retrieveFileInfo(matric){
username = getUsername(matric)
filename = username + ".gif"
server = "http://blahblahblah/yaddieyaddie/"
# some code to determine whether or not the file exists
# where do i start
# e.g if (retrieve.(server+filename) != none):
# do something
}
e.g. given the matric value '9728430' i find that the corresponding user
has username == 'lreilly'. if this person has their image stored on the
external server then it will be called 'lreilly.gif'.
i don't need to actually retrieve the file from python - only determine
whether or not it exists or not. i.e. whether the http request reports a
404 or maybe even if the image size == 0 bytes.
could someone possible be kind enough to give me an idea where to start?
a url? a snippet of code?
thanks very much in advance,
lee
More information about the Python-list
mailing list