I write a function to export the csv data, but i don't know how to request the export url to upload the csv file to ftp server in ruby ? Who can tell me how to do?
You can use net/ftp to solve this problem.
require 'net/ftp'
require 'open-uri'
Net::FTP.open('SERVER_Name', 'USER', 'Password') do |ftp|
ftp.passive = true
ftp.putbinaryfile("Your.csv")
end
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With