mirror of
https://github.com/fog/fog.git
synced 2022-11-09 13:51:43 -05:00
[rackspace|storage] fixing large upload example and documentation
This commit is contained in:
parent
8f2c84ae93
commit
a584d8f7e9
2 changed files with 4 additions and 4 deletions
|
@ -382,8 +382,8 @@ Cloud Files requires files larger than 5 GB to be uploaded into segments along w
|
|||
read = 0
|
||||
# upload segment to cloud files
|
||||
service.put_object("my_container", "large_file/#{segment}", nil, options = {}) do
|
||||
if (offset < SEGMENT_LIMIT) && (read.zero? || read == BUFFER_SIZE)
|
||||
buf = f.sysread(BUFFER_SIZE)
|
||||
if (offset < SEGMENT_LIMIT) && !f.eof?
|
||||
buf = f.read(BUFFER_SIZE)
|
||||
read = buf.size
|
||||
offset += read
|
||||
buf
|
||||
|
|
|
@ -69,9 +69,9 @@ File.open(file_name) do |f|
|
|||
offset = 0
|
||||
read = 0
|
||||
service.put_object(directory.key, "#{segment_name}/#{segment}", nil, options = {}) do
|
||||
if (offset < SEGMENT_LIMIT) && (read.zero? || read == BUFFER_SIZE)
|
||||
if (offset < SEGMENT_LIMIT) && !f.eof?
|
||||
print "."
|
||||
buf = f.sysread(BUFFER_SIZE)
|
||||
buf = f.read(BUFFER_SIZE)
|
||||
read = buf.size
|
||||
offset += read
|
||||
buf
|
||||
|
|
Loading…
Add table
Reference in a new issue