title: How can I send an R file through the web server using java?
body: <p>I have a Java web application running.</p>
  
  <p>Now, I have this R sample script:</p>
  
  <pre><code>zz &lt;- file(outputTarget, "w")  
  cat("TITLE extra line", "2 3 5 7", "", "11 13 17", file = zz, sep = "\n")
  cat("One more line\n", file = zz)
  close(zz)
  </code></pre>
  
  <p>When "outputTarget" = <code>D://R-Stuff//dataOut.txt</code> the file is created fine.</p>
  
  <p>Now, I need to send this file to my web server.</p>
  
  <p>The only thing that comes to my mind is to change "outputTarget" to <code>http://myhost:8080/myapplication/mystrutsaction/dataOut.txt</code> but I'm sure this will not work because Struts cannot handle this.</p>
  
  <p>What I need to do (in generic way, how can I handle a file saved to URL in Java Web application)? </p>