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 which was received but it only contains a small portion of the orginal 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);
SetActive();
}
else
{
//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);
SetActive();
}
}
Hi! My program transfers files from phone to PC but not over FTP. I am using the Serial Port Service instead. But my program has some flaws as it can only send just a portion of a file over bluetooth. I have not yet work on it much coz i got another program to do now.
I think i have in my file some sample programs that i have found before that might be of help to you. I'll check them out later and post the result here.
Check out the sample program of Ashley Montanaro that uses the CSendAppUi to send files through Blutetooth, IR, or e-mail. I hope it could help you in any way.. You can download it at http://www.allaboutsymbian.com/softw...oft.php?id=212