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.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/adn_viewer.rb +2 -2
  3. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 5ca47a09bdd4bfeba61a3506db04caae43f9e8b6
4
- data.tar.gz: 8f7c2da1ac90f9f54751fa224dd7b7d344d8e33a
3
+ metadata.gz: f681cb97af02850994f65494575bea219dbe7792
4
+ data.tar.gz: b37c56049de6cc753e4d695934f1f44fb43b0641
5
5
  SHA512:
6
- metadata.gz: 69977d44dc66d49759307287e98b9f48c93732c9c4f2e2d5adf79e48adaf6435e6bad360f5a0dee56c3f0f3612da823ef34874bf1d1ae420ea28e508864997c4
7
- data.tar.gz: 0ef0c97425657f68b77208adf7115e1db57a3c5857900d4401089fb4ccd529e0e49be1551331776096b1af03ac04ebe21ea4c62298da44d31ca8600555e2e544
6
+ metadata.gz: e8634dd1a02fef83e9807ffaf930e3d2be002ba51b4d9da24716d3a2d2476bbd5c09f3f0199ff6970e5cf348eebe2149c423f556bb3bf4946d0960ccba9713b6
7
+ data.tar.gz: c8d700fbcef50a33c50df19c690febc446622e45c9f9d3ef311c2798a5145aef2fb9873d4a5c8d6a39954aef85bdc839880f78ff70ce35a939e4f4eb4457eb97
@@ -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"] = 1000000
40
+ request["Content-Length"] = filesize
41
41
  else
42
42
  request.body_stream=File.open(filepath)
43
43
  request["content-type"] = 'application/octet-stream'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: adn_viewer
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.1
4
+ version: 1.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Pratham Makhni Alag