have you tried buf = urllib.urlopener(....).read() f = file('/somefile.jpg', 'wb') f.write(buf) f.close()
Jose SamDonaldson wrote: > Guys, I have one short question and this relates to the FieldStorage > Pylons file object in the way it represents a posted image. Does > anybody know what the 'file' attribute's type is in the object on > which read/write/close is invoked? I'm trying to do the following: > > I'm reading in binary data from somewhere into memory, and I want to > now convert that into an image file. What are the steps to do that: > > buf = urllib.urlopner(....).read() > f = open(buf, 'wb') > But this has created a file descriptor...What's happening is that > after I call read() on f, I'm getting a bad file descriptor error. > How do I fix this problem? > > Thanks, > > Sam > > > > > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "pylons-discuss" group. To post to this group, send email to pylons-discuss@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/pylons-discuss?hl=en -~----------~----~----~----~------~----~------~--~---