if I'm trying to transmit a 'file' that is actually saved on the HD, the code from the link in my first post works fine (reading in the file using binary mode access). My problem is that I'm trying to figure out how to transfer data that isn't yet saved to the drive, because I'm wanting to be able to send any sort of data type across the connection. This is getting rather frustrating because I'm getting so many replies back that aren't even attempts at answers, but rather questions about things I'm not trying to do. I'll restate the problem.
grab image data from server side connection. transfer image data to client side write image data to file on client side. I've already established a working RPC connection, and if I transmit a 'file' that can be read using binary mode (exact same code as posted in both the link in my first email, and by others in this thread) it works fine. My problem I'm trying to overcome is that I ***do not want to write the image data from the server to a file, just to send it, then delete the image file on the server*** For this specific challenge, I've found no actual "how-to" help... Just bits of information making it sound possible. Again, I dont want to "file transfer" anything, I want to send data that isn't in the default data-types for xml-rpc, which I've read can be done using binary mode transfers. On 12/30/06, Kent Johnson <[EMAIL PROTECTED]> wrote:
Chris Hengge wrote: > I might have been unclear, or this tid-bit might have been lost in the > thread... but I'm trying to send directly from ImageGrab.Grab(), without > saving the data as a file. Thats where I'm getting hung... If it try to > send an actual stored file, I have no problem. Is this maybe impossible? > My thought was that I could just save a little process time and file > fragmentation if I cut out the middle man, plus there really is no > reason to save the screen capture on the server side. Can you show the code that works? If you are writing your image data to a file, then using something like Lee's example below, that just reads the file data into a Binary object, you should be able to just create the Binary object from the image data directly. Kent > > Maybe I really need to look into SOAP for this sort of stuff? I'm just > playing with the technology, and from the searching I've done, the > XML-RPC seemed to fit my needs best. I could certainly be wrong though. > > Thanks for both of you giving me feedback. > > On 12/29/06, *Lee Harr* <[EMAIL PROTECTED] > <mailto:[EMAIL PROTECTED]>> wrote: > > > http://www.velocityreviews.com/forums/t343990-xmlrpc-send-file.html > <http://www.velocityreviews.com/forums/t343990-xmlrpc-send-file.html > > > > >Using this example I get error's about 'expected binary .read(), > but got > >instance instead. > > > I assume you are using this ... > > >d = xmlrpclib.Binary(open("C:\\somefile.exe").read()) > > > Are you using windows? > > I think you would need to pass the binary flag to open ... > > imagedata = open(filename, 'rb').read() > > > > It's probably a good idea to use the binary flag if you are expecting > binary data just in case it gets ported somewhere else later. > > > >I've just been using xmlrpclib and simplexmlrpcserver for this, > but I'm > >wondering if I should perhaps use twisted instead. > > I've used xml-rpc to send image data before. It worked. > > _________________________________________________________________ > Don't just search. Find. Check out the new MSN Search! > http://search.msn.com/ > > _______________________________________________ > Tutor maillist - Tutor@python.org <mailto:Tutor@python.org> > http://mail.python.org/mailman/listinfo/tutor > <http://mail.python.org/mailman/listinfo/tutor> > > > > ------------------------------------------------------------------------ > > _______________________________________________ > Tutor maillist - Tutor@python.org > http://mail.python.org/mailman/listinfo/tutor
_______________________________________________ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor