File Transfer Error
Posted: Sun Aug 18, 2024 9:30 am
Hi Guys!!
I am having trouble getting a file transfer to occur. I have been going around in circles trying to get this to work but it is giving me lots of dramas!
My Client code is:
And my server code is:
I have been banging my head against the wall with this!!!
Any and all replies/suggestions will be greatly received!!
Googie.
I am having trouble getting a file transfer to occur. I have been going around in circles trying to get this to work but it is giving me lots of dramas!
My Client code 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 "C:\users\user\documents\FILE.tmp" into tFile
put URL ("binfile:" & tFile) into temp["data"]
set itemdel to "/"
put the last item of tFile into temp["name"]
put base64encode(arrayencode(temp)) into tAll
write tAll & "file§" to socket theIP
read from socket theIP with message "MESSAGES1"
end DONEA
on MESSAGES1 theIP theMessage
read from socket theIP 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
put arraydecode(base64decode(pmsg)) into temp
put "C:/USERS/ADMIN/Documents/RECEIVE.tmp" into tName
put temp["data"] into URL ("binfile:" & tName)
end if
read from socket theIP with message "NEWMESSAGE"
end NEWMESSAGE
Any and all replies/suggestions will be greatly received!!
Googie.