https://gist.github.com/anonymous/b789bf44fcd30c1bc721756346ce52a1

Sending text is perfectly, but when I tried to send an image, it would send all the data except for the last 1 kilobyte of my image. How do I send the image pergectly? I have tired every other forum but I can't find anything. All the close things did not work. Thanks

Recommended Answers

All 6 Replies

socket.send() may not send all its data as per the socket module's documentation. Use sendall() for example.

I had tried using sendall, but even that will not work. I cannot find anything on google or anywhere else.

f=open('conflict.png','wb') should be out of the while loop !

I did that and it is still not sending it. I am wondering if something is interfering with the stream.

Can you post your code (in the forum please, not in github) ?

I figured out what to do. I was not creating a big enough buffer. It works now! thanks

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.