[REBOL] Using rebol for file transfers over Terminal Services
From: james::mustard::co::nz at: 5-Feb-2004 8:26
Had a request from a client today on how to copy photos from a digital
camera on their local machine to their Win2k server in another town that
they access via MS Terminal Services. After a bit of investigating it
seemed you needed ICA or Citrix to allow file sharing between the local
and remote machines.
We were about to give up when I remembered that terminal services allows
text cutting and pasting between sessions. The script below opens a
file dialog box from which you can select any number of files (be aware
it borks on .lnk files) and then uses Rebol to mold compress them then
send to clipboard - then all we needed to do was run a simple do read
clipboard:// script on the other end to restore all the files to the
local directory.
(There is also a view version of this script if anyone is interested)
Here's the packaging script:
rebol[]
;copy and paste any file(s) over terminal services connections
copy-any-files: func [fileblock /local b h f s newfile][
if none? fileblock [return]
s: copy ""
foreach filename fileblock [
newfile: split-path filename
h: "rebol[]^/tfile: do decompress "
b: compress mold read/binary filename
f: join "^/write/binary %" [newfile/2 " tfile ^/"]
append s join h [b f]
]
write clipboard:// s
]
copy-any-files request-file
;----------------------------------
;Unpack script: for remote machine / paste destination
rebol[]
do read clipboard://
;------------------------------------
Regards,
James.<