#!/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 "$@"  altTransferFiles2#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 whiteblackwhiteblack& revstackfalse Sendreiver Ums sans serif@Ums sans serifUArial@UArial UArial @UArial UArial @UArial Wms sans serif Ums sans serif Ums sans serif Wms sans serif @Ums sans serif cREVGeneralscriptChecksumuÕxʕMy.B bookmarks handlerListopenStack startAcceptingConnections stopAcceptingConnections newConnection moreData closeConnection doneSending closeStack doMsg linkClicked gotit tempScript prevHandlergotitscriptSelectionscript

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  & Port: New Button uzon menuPick m switch m case "Server" show group "server_group" hide group "client_group" hide grp "info" break case "Client" hide group "server_group" show group "client_group" hide group "info" break case "Instructions" hide group "server_group" hide group "client_group" show group "info" break end switch end menuPick  Server Client Instructions cREVGeneralscriptChecksum.Pns356$zNz bookmarks handlerListmenuPickscriptSelectionchar 330 to 329 prevHandlermenuPick tempScriptscript

on menuPick m

switch m

case "Server"

show group "server_group"

hide group "client_group"

hide grp "info"

break

case "Client"

hide group "server_group"

show group "client_group"

hide group "info"

break

case "Instructions"

hide group "server_group"

hide group "client_group"

show group "info"

break

end switch

end menuPick

 server_groupap cREVGeneral revUniqueID 1021186792865 Start ServerEpqon mouseUp if the short name of me = "Start Server" then #set the propInitLibrary of this stack to true put field "port" into iPort startAcceptingConnections iPort set the name of me to "Stop Server" else #set the propInitLibrary of this stack to false stopAcceptingConnections set the name of me to "Start Server" end if end mouseUp Rf  cREVGeneralscriptChecksum!T_[u4@ύ revUniqueID 1021174485802 bookmarks handlerListmouseUp tempScript prevHandlermouseUpscriptSelectionchar 306 to 305script"

on mouseUp

if the short name of me = "Start Server" then

#set the propInitLibrary of this stack to true

put field "port" into iPort

startAcceptingConnections iPort

set the name of me to "Stop Server"

else

#set the propInitLibrary of this stack to false

stopAcceptingConnections

set the name of me to "Start Server"

end if

end mouseUp

default_folder ` 4  cREVGeneral revUniqueID 1021187226166  "C:/Program Files/Revolution 1.1.1  New Field 2 " cREVGeneral revUniqueID 1021187336096 %Folder where files will be saved to: Browse...Epon mouseUp answer folder "Choose a new folder to save files to:" if it is not empty then put it into fld "default_folder" end if end mouseUp H cREVGeneralscriptChecksumAU}_O . revUniqueID 1021187204082 bookmarks handlerListmouseUp tempScript prevHandlerscriptSelectionchar 137 to 136script

on mouseUp

answer folder "Choose a new folder to save files to:"

if it is not empty then

put it into fld "default_folder"

end if

end mouseUp

 ipaddress J cREVGeneral revUniqueID 1021789444778  client_groupa(b cREVGeneral revUniqueID 1021186880261 Send File...Epon mouseUp answer file "Select a File:" if it is not empty then put it into fName else exit mouseUp end if show img "spin" set the repeatcount of img "spin" to -1 # get the name of the file set the itemDelimiter to "/" put last item of fName into line 1 of mOut open file fName for binary read read from file fName until eof put it into fData close file fName # encode the file put base64Encode(fData) into fData put fData into line 2 of mOut put return & "" after mOut put field "Server"&":"&field "port" into s open socket s for write doMsg "Opening Socket: "&s write mOut to socket s with message "doneSending" end mouseUp Rf  cREVGeneralscriptChecksumgFJqXp%٨ bookmarks revUniqueID 1021180546020 handlerListmouseUpscriptSelection char 14 to 13 prevHandlermouseUp tempScriptscript/

on mouseUp

answer file "Select a File:"

if it is not empty then

put it into fName

else

exit mouseUp

end if

show img "spin"

set the repeatcount of img "spin" to -1

# get the name of the file

set the itemDelimiter to "/"

put last item of fName into line 1 of mOut

open file fName for binary read

read from file fName until eof

put it into fData

close file fName

# encode the file

put base64Encode(fData) into fData

put fData into line 2 of mOut

put return & "</altend>" after mOut

put field "Server"&":"&field "port" into s

open socket s for write

doMsg "Opening Socket: "&s

write mOut to socket s with message "doneSending"

end mouseUp

server)`blackx,    ,x Server to Connect to: theMsg)`H cREVGeneralscriptChecksumُ B~ bookmarks revUniqueID 1021186856538 handlerListscriptSelection char 1 to 0 prevHandler linkClicked tempScriptscript

 `@F  New Field 1  cREVGeneral revUniqueID 1021189648639 Created by Altuit. inc.  http://www.altuit.com  ResetEp'on mouseUp if the shiftKey is down then put empty into fld "port" put empty into fld "server" put empty into fld "ipaddress" end if stopAcceptingConnections set the name of btn id 1004 to "Start Server" hide img "spin" set the repeatcount of img "spin" to 0 end mouseUp @B cREVGeneralscriptChecksum(HdmNR]%X0 revUniqueID 1021190975042 bookmarks handlerListmouseUp tempScript prevHandlermouseUpscriptSelectionchar 139 to 138scriptB

on mouseUp

if the shiftKey is down then

put empty into fld "port"

put empty into fld "server"

put empty into fld "ipaddress"

end if

stopAcceptingConnections

set the name of btn id 1004 to "Start Server"

hide img "spin"

set the repeatcount of img "spin" to 0

end mouseUp

 New Field 3 % cREVGeneral revUniqueID 1021191222317 Log:infoiv cREVGeneral revUniqueID 1021192225312  Instructions h blackn cREVGeneral revUniqueID 1021192199694 bookmarks handlerList tempScript prevHandlerscriptSelectionscript  ̘ć8Ǐ!rD!˖K; cREVGeneral revUniqueID 1021791928581