-
-
Save evsapi/2697517 to your computer and use it in GitHub Desktop.
IDrive - EVS - REST API - downloadFile
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/eruby | |
| <% | |
| require "net/https" | |
| require 'uri' | |
| require 'rexml/document' | |
| base_url = "[url retrieved from getServerAdress API call]" | |
| uid = "[your user name]" | |
| pwd = "[your password]" | |
| uri = URI.parse("https://" + base_url) | |
| http = Net::HTTP.new(uri.host, uri.port) | |
| targetfile = "[path to file you wish to download]" | |
| http.use_ssl = true | |
| http.verify_mode = OpenSSL::SSL::VERIFY_NONE | |
| request = Net::HTTP::Post.new("/evs/downloadFile") | |
| request['content-type'] = "multipart/form-data" | |
| parameters = {} | |
| parameters['uid'] = uid | |
| parameters['pwd'] = pwd | |
| parameters["p"] = targetfile | |
| parameters["version"] = '1' | |
| parameters["thumbnail_type"] = 'I' | |
| request.set_form_data(parameters) | |
| response = http.request(request) | |
| puts response | |
| %> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment