1

It seems like net/scp in Ruby (I'm using 1.8.7) only accepts a path and not binary data as "local_file" parameter.

In my case, I have the local file stored in a variable. Am I required to save->upload->delete a local file, or is it possible to send the file "directly" to the remote server via SSH without temporary creating it locally?

I'm open to other solutions than SCP. What I tried so far is using normal SSH and then executing

echo 'binary here' > remote_file_name

however I'm concerned about command length limits in Unix and I faced escaping problems and so forth...

1 Answer 1

2

While it will interpret a string as a file name, it should recognise a StringIO object as actual data to upload.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.