Thanks Salem, but that still did not work This is what I have now:
PHP Code:
bool CONNECTION::SendBinary()
{
char Buffer[10000];
// Open the file as binary
ifstream hFile (RealFile.c_str(), ios::binary);
int X = 0;
while ( (X = hFile.readsome(Buffer, sizeof(Buffer)) ) > 0 )
{
send(SFD, Buffer, X, 0); // Send data as we read it
}
hFile.close(); // Close
return true;
}
But its not sending anything still :S Yet when I use the read() function I used to have, it sent everything (but then a load of crap at the end when it reached the end of the file).