carrierwave-sharefile 0.0.4 → 0.0.5
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c9d3d778c5315ba5cef24d5ba56a2fe3c8101b3c
|
4
|
+
data.tar.gz: 12328b610a0e5c7c14be936d018a5bfea3102037
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c6f57501158c8a9d0867bdaa596082778c31bf11d493d533b438321d8aa8db952102d88d8af918d9f0237a24108b020752dc6ce3b5d291e1361753fcb2de3acf
|
7
|
+
data.tar.gz: fb414c7aa99900b5697f2026d982066cbeed1c665dc04a8cad63293f1373be464065117e0cdcdde022e63b6172460880d56c31f246026ab67b8bfa13306c4bfa
|
@@ -60,7 +60,7 @@ module CarrierWave
|
|
60
60
|
|
61
61
|
def upload_media(url, tmpfile)
|
62
62
|
newline = "\r\n"
|
63
|
-
filename = tmpfile.
|
63
|
+
filename = File.basename(tmpfile.path)
|
64
64
|
boundary = "ClientTouchReceive----------#{Time.now.usec}"
|
65
65
|
|
66
66
|
uri = URI.parse(url)
|
@@ -70,7 +70,7 @@ module CarrierWave
|
|
70
70
|
post_body << "Content-Disposition: form-data; name=\"File1\"; filename=\"#{filename}\"#{newline}"
|
71
71
|
post_body << "Content-Type: application/octet-stream#{newline}"
|
72
72
|
post_body << "#{newline}"
|
73
|
-
post_body << File.read(tmpfile.
|
73
|
+
post_body << File.read(tmpfile.path)
|
74
74
|
post_body << "#{newline}--#{boundary}--#{newline}"
|
75
75
|
|
76
76
|
request = Net::HTTP::Post.new(uri.request_uri)
|
@@ -116,7 +116,7 @@ module CarrierWave
|
|
116
116
|
# [Boolean] true on success or raises error
|
117
117
|
#
|
118
118
|
def store(file)
|
119
|
-
sharefile_file = file
|
119
|
+
sharefile_file = file.to_file
|
120
120
|
@content_type ||= file.content_type
|
121
121
|
root_folder = @config[:sharefile_root]
|
122
122
|
@file = @client.store_document(root_folder, @path, sharefile_file)
|