I have made some progress from my last post and I am losing packets during the file send using Base64.
My Client is:
Code: Select all
global WSITE
on openStack
   put "192.168.1.2:12345" into WSITE
   open socket to WSITE with message "DONEA"
end openStack
on 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 DONEA
on MESSAGES1 theIP theMessage
   read from socket theIP until "§" with message "MESSAGES1"
end MESSAGES1
Code: Select all
on openStack
   accept connections on port 12345 with message "CONNECT"
end openStack
on CONNECT theIP 
   read from socket theIP with message "NEWMESSAGE"
end CONNECT
on 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
Many Thanks,
Googie.

