#!/bin/sh # MetaCard 2.4 stack # The following is not ASCII text, # so now would be a good time to q out of more exec mc $0 "$@" altTransferFiles 2 #global gDATA on openStack put the defaultFolder into fld "default_folder" open socket to "www.google.com:80" with message "gotit" end openStack on startAcceptingConnections iPort put "Start Accepting Connections on: " & iPort into fld "theMsg" accept connections on port iPort with message "newConnection" end startAcceptingConnections on stopAcceptingConnections put empty into fld "theMsg" put the number of lines of the openSockets into iSockets repeat iSockets close socket (line 1 of the openSockets) end repeat end stopAcceptingConnections on newConnection s global gDATA doMsg "newConnection: "& peeraddress(s) show img "spin" set the repeatcount of img "spin" to -1 put empty into gDATA read from socket s with message "moreData" end newConnection on moreData s,m global gDATA #doMsg m put m after gDATA if last line of gData = "" then #doMsg "got last line" delete last line of gData hide img "spin" set the repeatcount of img "spin" to 0 put line 1 of gDATA into f1Name delete line 1 of gDATA put fld "default_folder" &"/"& f1Name into fName domsg "fName:" & fName put base64decode(gDATA) into gDATA open file fName for binary write write gDATA to file fName close file fName doMsg "File Transfered: " & f1Name closeConnection s else doMsg "still reading" read from socket s with message "moreData" end if end moreData on closeConnection s doMsg "Closing Connections: "& s close socket s put emtpy into gDATA end closeConnection on doneSending s doMsg "done Sending" hide img "spin" set the repeatcount of img "spin" to 0 closeConnection s end doneSending on closeStack stopAcceptingConnections end closeStack on doMsg theMsg put return & theMsg after fld "theMsg" select after last char of fld "theMsg" end doMsg on linkClicked pLink revGoURL pLink end linkClicked on gotit put "This machine's IP Address: " & hostAddress("www.google.com:80") into fld "ipaddress" close socket "www.google.com:80" end gotit white black white black & revstack false Sendreiver U ms sans serif @U ms sans serif U Arial @U Arial U Arial @U Arial U Arial @U Arial W ms sans serif U ms sans serif U ms sans serif W ms sans serif @U ms sans serif cREVGeneral scriptChecksum u ÕxʕMy.B bookmarks handlerList openStack startAcceptingConnections stopAcceptingConnections newConnection moreData closeConnection doneSending closeStack doMsg linkClicked gotittempScript prevHandler gotitscriptSelection script
global gDATA
on openStack
put the defaultFolder into fld "default_folder"
open socket to "www.google.com:80" with message "gotit"
end openStack
on startAcceptingConnections iPort
put "Start Accepting Connections on: " & iPort into fld "theMsg"
accept connections on port iPort with message "newConnection"
end startAcceptingConnections
on stopAcceptingConnections
put empty into fld "theMsg"
put the number of lines of the openSockets into iSockets
repeat iSockets
close socket (line 1 of the openSockets)
end repeat
end stopAcceptingConnections
on newConnection s
global gDATA
doMsg "newConnection: "& peeraddress(s)
show img "spin"
set the repeatcount of img "spin" to -1
put empty into gDATA
read from socket s with message "moreData"
end newConnection
on moreData s,m
global gDATA
#doMsg m
put m after gDATA
if last line of gData = "</altend>" then
#doMsg "got last line"
delete last line of gData
hide img "spin"
set the repeatcount of img "spin" to 0
put line 1 of gDATA into f1Name
delete line 1 of gDATA
put fld "default_folder" &"/"& f1Name into fName
domsg "fName:" & fName
put base64decode(gDATA) into gDATA
open file fName for binary write
write gDATA to file fName
close file fName
doMsg "File Transfered: " & f1Name
closeConnection s
else
doMsg "still reading"
read from socket s with message "moreData"
end if
end moreData
on closeConnection s
doMsg "Closing Connections: "& s
close socket s
put emtpy into gDATA
end closeConnection
on doneSending s
doMsg "done Sending"
hide img "spin"
set the repeatcount of img "spin" to 0
closeConnection s
end doneSending
on closeStack
stopAcceptingConnections
end closeStack
on doMsg theMsg
put return & theMsg after fld "theMsg"
select after last char of fld "theMsg"
end doMsg
on linkClicked pLink
revGoURL pLink
end linkClicked
on gotit
put "This machine's IP Address: " & hostAddress("www.google.com:80") into fld "ipaddress"
close socket "www.google.com:80"
end gotit
@ & port )` black . cREVGeneral revUniqueID 1021174542144 8282 &