ForeverCode
Programmer
File.Open(RFile, CFile::shareDenyNone | CFile::typeBinary, &pError)
UINT nRead;
nRead = File.Read(FileData, 8192);
while (nRead == 8192){
AllData.Format("%s", FileData);
send(work, AllData, 8192, 0);
nRead = File.Read(FileData, nRead);
}
if( nRead > 0 ){
AllData.Format("%s", FileData);
send(work, AllData, nRead, 0);
}
With the above code I can open text files fine, but if I try to open anything else(gif, jpg, zip, etc.) and send the data through the socks the data is all messed up...
I think it is because the CString terminating at the NULLs in the file but im not sure...Anyone know how to fix this problem?
UINT nRead;
nRead = File.Read(FileData, 8192);
while (nRead == 8192){
AllData.Format("%s", FileData);
send(work, AllData, 8192, 0);
nRead = File.Read(FileData, nRead);
}
if( nRead > 0 ){
AllData.Format("%s", FileData);
send(work, AllData, nRead, 0);
}
With the above code I can open text files fine, but if I try to open anything else(gif, jpg, zip, etc.) and send the data through the socks the data is all messed up...
I think it is because the CString terminating at the NULLs in the file but im not sure...Anyone know how to fix this problem?