1
0
Why don't these work when trying to copy a file from one location to another?
1) Base64 encode the file at source, write (binary or ascii) base64 decoded at destination.
2) Open file in notepad, copy/paste contents into destination.
Is there a way to move a file as text with the clipboard? Example of use environment: transferring files over remote desktop without enabling shared local drives.
Edit - Just to clarify, I'm talking about any type of file, not just text (zip, for instance).
I'm using the built-in Microsoft client, and in this particular case I am on 32-bit XP with a remote session to 32-bit Server 2003 R2. Because text is the only thing that will copy/paste (files don't), I am trying to encode the remote files as text and then copy/paste them to my local machine. – wes – 2011-02-22T16:39:05.497
What base64 en/decoder do you use? – deiga – 2011-02-22T16:41:06.947
I had been trying Python's base64 module: b64encode, b64decode. Example:
– wes – 2011-02-22T16:42:19.330base64.b64encode(open('myfile.zip').read())
andopen('myfile.zip', 'w').write(base64.b64decode('<previous result>'))
Hmm, can't test python on any target machine now, so don't know why that doesn't work. I don't see any flaws, though. Updated the answer. @wes – deiga – 2011-02-22T17:03:46.450
Alright, well your edit worked for me even on an encrypted 7z, so at least I know this is possible and I just need to tweak my implementation. Thanks! – wes – 2011-02-22T17:27:11.053