I
Idealone Ideally
Hi All,
I want to download a file from my web application using/calling
ruby code.
Manually i can download reports by clicking on 'DOWNLOAD' button in my
app, which in turn gets the file from servlet path(where the files are
stored).
My question is, how can i automate this download part in ruby, if its
feasible.
During my googling, i found a set of ruby code to download pictures
from a site.
snippet of the code looks like this:
<CODE>
require 'net/http'
Net::HTTP.start("static.test.com") { |http|
resp = http.get("/92/2134322cedc5fef7_o.jpg")
open("fun.jpg", "wb") { |file|
file.write(resp.body)
}
}
<CODE>
Please let me know if i could use similar technique to download a
file(excel file).
Thanks
I
I want to download a file from my web application using/calling
ruby code.
Manually i can download reports by clicking on 'DOWNLOAD' button in my
app, which in turn gets the file from servlet path(where the files are
stored).
My question is, how can i automate this download part in ruby, if its
feasible.
During my googling, i found a set of ruby code to download pictures
from a site.
snippet of the code looks like this:
<CODE>
require 'net/http'
Net::HTTP.start("static.test.com") { |http|
resp = http.get("/92/2134322cedc5fef7_o.jpg")
open("fun.jpg", "wb") { |file|
file.write(resp.body)
}
}
<CODE>
Please let me know if i could use similar technique to download a
file(excel file).
Thanks
I