Message-ID: <3A929933.AA4F81@cs.strath.ac.uk>
Date: Tue, 20 Feb 2001 16:20:03 +0000
From: Lee Reilly CS1997 <lreilly@cs.strath.ac.uk>
Organization: Department of Computer Science, University of Strathclyde
X-Mailer: Mozilla 4.75 [en] (Win98; U)
X-Accept-Language: en
MIME-Version: 1.0
Newsgroups: comp.lang.python
Subject: retrieving file data from an external server - where to start?
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
NNTP-Posting-Host: k42.cs.strath.ac.uk
X-Original-NNTP-Posting-Host: k42.cs.strath.ac.uk
X-Trace: 20 Feb 2001 16:20:05 GMT, k42.cs.strath.ac.uk
Path: nntphost.cs.strath.ac.uk!k42.cs.strath.ac.uk
Xref: nntphost.cs.strath.ac.uk comp.lang.python:52930

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

