Hi all,

I'm trying to transfer a jpeg file over BT using Rfcomm.
The problem is that only one part of the image is transferred correctly. Anyone can help me? Please is very important! Thx!

This is my code:

Code:
 

void CAPAClient::SendPhotoL()
    {
		if ( iState != EConnected )
		{
			Log(_L("Error: Disconnected"));
			User::Leave( KErrDisconnected );
		}
		
		RFs fsSession = CEikonEnv::Static()->FsSession();
		RFile file;
		_LIT(KStoreFileName, "C:\\Nokia\\Images\\test2.jpg");
		TInt err1 = file.Open(fsSession, KStoreFileName, EFileRead); 
		CleanupClosePushL(file);

		if (err1!=KErrNotFound){ 


		TInt size;
		file.Size(size);
		HBufC8* mybuffer=HBufC8::NewL(size);

		TInt err;
		TPtr8  pBuf = mybuffer->Des();
		file.Read(pBuf);
		User::WaitForRequest(iStatus);
		iSendingSocket.Write(pBuf, iStatus);

		}
		

		CleanupStack::PopAndDestroy();		//file
		SetActive();   
		   
    }