Transfering fail from FTP connection

Hi

I need to make an application witch get some file from a ftp server.
Now i can log in, I seting up a directory but when i send a query for a
RETR some_file, I got only this..

Opening ASCII mode data connection for some_file.dat (486 Bytes).

..and I don't have my file.

My procedure to recive looks like this :

1
2
3
4
5
6
7
8
9
result = recv(sock, buf, buflen, 0); 
                   cout<<endl<<result; 
                    
                   if ( result < 0 ) 
                        printf("Recv failed: %d\n", WSAGetLastError()); 
                   else if ( result == 0 ) 
                        printf("Connection closed\n"); 
                   cout<<buf; 
                   fwrite(buf, 1024, 1, fw);



Can You help me with this?
Thanks
BR
Topic archived. No new replies allowed.