title: How do I upload a file with the remote file destination as part of the URL?
body: <p>I have the following method for uploading files:</p>
  
  <pre><code>def send_to_ftp(sourcefile,host,port,username,password,log_path)
    begin
      ftp =Net::FTP.new
      ftp.connect(host, port)
      ftp.passive = true
      ftp.login(username, password)
      ftp.chdir(host)
      ftp.putbinaryfile(sourcefile)
      ftp.close
      return true
    rescue Exception =&gt; err
      puts err.message
      return false
    end
  end
  </code></pre>
  
  <p>When I enter the URL as <code>hostname.com/path/to/ftpupload</code>,  I get an error: "name or service not known". However, if I enter only "hostname.com" as the host it works but it means there's no way of determining where to put the file on the ftp server</p>