Quantcast
Channel: LiveCode Forums
Viewing all articles
Browse latest Browse all 674

Android Deployment • File Send Over Base64.

$
0
0
Hii Guys!!

I have made some progress from my last post and I am losing packets during the file send using Base64.

My Client is:

CODE:

global WSITEon openStack   put "192.168.1.2:12345" into WSITE   open socket to WSITE with message "DONEA"end openStackon DONEA theIP   put "binfile:C:/Users/USER/Documents/TEST.jpg" into tFile   put URL tFile into temp   put base64encode(temp) into tAll   replace cr with empty in tAll   write tAll & "file§" to socket theIP   read from socket theIP until "§" with message "MESSAGES1"end DONEAon MESSAGES1 theIP theMessage   read from socket theIP until "§" with message "MESSAGES1"end MESSAGES1
And my Server is:

CODE:

on openStack   accept connections on port 12345 with message "CONNECT"end openStackon CONNECT theIP    read from socket theIP with message "NEWMESSAGE"end CONNECTon NEWMESSAGE theIP pmsg   if char -5 to -1 of pmsg is "file§" then      delete  char -5 to -1 of pmsg      //replace cr with empty in pmsg      put base64decode(pmsg) into temp      put "C:/USERS/Goodie/Documents/TESTRECEIVE.jpg" into tName      put temp into URL ("binfile:" & tName)    end if   read from socket theIP until "§" with message "NEWMESSAGE"end NEWMESSAGE
The majority of the image file is sent, although it is losing some packets over the transfer. Can anyone spot what is going on?

Many Thanks,

Googie.

Statistics: Posted by Googie85 — Mon Aug 19, 2024 3:23 am



Viewing all articles
Browse latest Browse all 674

Trending Articles