Hello everyone!

I am trying to modify the BTPointToPointExample to send a file to PC.

I declared a byte descriptor where i read the file i would like to send and then send this byte descriptor to PC which will be written to another file. The type of file i am trying to send is a .jpg file. I have checked the content of the .jpg file but there's no preview available. The text content of it though which i have checked by opening it with Notepad only contains a small portion of the orginal Notepad content of the .jpg file on the phone. I have tried doing the reading of file until the byte descriptor's length is zero (which means, it has reached EOF) but my application could not send any byte to PC anymore.

Here is my code which sends byte descriptor from phone to PC via bluetooth sockets:

TFileName KFile(_L("C:\\system\\apps\\MMSExample\\mmsexample.jpg"));
//a file session has been opened to read the file
TInt err = iFile.Open(CEikonEnv::Static()->FsSession(), KFile, EFileRead | EFileShareAny);
if( err != KErrNone)
//display an error message
iSendingSocket.Write(*iMessage, iStatus);
//read the file and store in a descriptor(BytesRead)
TBuf8<64> BytesRead;
TInt buff_length = BytesRead.Length();
while ( buff_length != 0)
TInt ReadResult = iFile.Read(BytesRead);
iSendingSocket.Write(BytesRead, iStatus);

Can anyone help me figure out hwat's wrong on my code?
Thanks in advance!

--julie ann