I want to upload files to remote sftp server with relative path. For example I want to be able to upload to sftp://myserver.com/FileStore
. I've tried using the following code but it does not work: NB: host is myserver.com/FileStore
uri = URI.parse('sftp://' + host)
Net::SFTP.start(uri.host,username,:password=>password,:port=>port) do |sftp|
sftp.upload(testupload.zip,"#{uri.path}/testupload.zip")
end
This is the error I get:
Net::SFTP::StatusException open /FileStore/testupload.zip (2, "no such file")