adn_viewer 1.0.1 → 1.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/adn_viewer.rb +2 -2
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f681cb97af02850994f65494575bea219dbe7792
|
4
|
+
data.tar.gz: b37c56049de6cc753e4d695934f1f44fb43b0641
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e8634dd1a02fef83e9807ffaf930e3d2be002ba51b4d9da24716d3a2d2476bbd5c09f3f0199ff6970e5cf348eebe2149c423f556bb3bf4946d0960ccba9713b6
|
7
|
+
data.tar.gz: c8d700fbcef50a33c50df19c690febc446622e45c9f9d3ef311c2798a5145aef2fb9873d4a5c8d6a39954aef85bdc839880f78ff70ce35a939e4f4eb4457eb97
|
data/lib/adn_viewer.rb
CHANGED
@@ -28,7 +28,7 @@ class Adn_Viewer
|
|
28
28
|
JSON.parse(CurbFu.get({:host => 'developer.api.autodesk.com', :path => '/viewingservice/v1/supported', :protocol => "https", :headers => { "Authorization" => "Bearer " + token, "Content-Type" => "application/json" }}).body)
|
29
29
|
end
|
30
30
|
|
31
|
-
def self.upload_file(token, name, filename, filepath)
|
31
|
+
def self.upload_file(token, name, filename, filepath, filesize = 0)
|
32
32
|
boundary = "AaB03xZZZZZZ11322321111XSDW"
|
33
33
|
uri = URI("https://developer.api.autodesk.com/oss/v1/buckets/" + name + "/objects/" + filename)
|
34
34
|
http = Net::HTTP.new(uri.host, uri.port)
|
@@ -37,7 +37,7 @@ class Adn_Viewer
|
|
37
37
|
if filepath.include? "http"
|
38
38
|
request.body_stream=open(filepath)
|
39
39
|
request["content-type"] = 'application/octet-stream'
|
40
|
-
request["Content-Length"] =
|
40
|
+
request["Content-Length"] = filesize
|
41
41
|
else
|
42
42
|
request.body_stream=File.open(filepath)
|
43
43
|
request["content-type"] = 'application/octet-stream'
|