[Zope] trying to open a file in database but couldn't

Allen Huang swapp0 at yahoo.com
Sun Feb 26 00:55:24 EST 2006


I'm trying to open a file that is in database but I got this error message instead
   
  coercing to Unicode: need string or buffer, instance found
   
  I don't quite understand why. My code looks like this
   
  def imageSetup(self, dataID, REQUEST):
    from StringIO import StringIO
   
      # Get the original image and data in memory and open the file
    imageData=getattr(self, dataID)
    imageDataFile=StringIO(str(imageData.data))
      tfw = open(imageDataFile, "r")
   
  I upload a text file into ZOPE database and
  the file consist of six lines of float point numbers that I want to use with REQUEST.set
   
  I call this method using 
  < dtml-call "imageSetup(textFile, REQUEST)" >
   
  can anyone help me... please...
  did I made a mistake with this code

		
---------------------------------
Yahoo! Mail
Bring photos to life! New PhotoMail  makes sharing a breeze. 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.zope.org/pipermail/zope/attachments/20060225/90511e9a/attachment.htm


More information about the Zope mailing list