Skip to content
Snippets Groups Projects
Commit 577d6e99 authored by Matheus Agio Nerone's avatar Matheus Agio Nerone
Browse files

changing verification of finished upload


Signed-off-by: default avatarman13 <man13@inf.ufpr.br>
parent dc141880
No related branches found
No related tags found
No related merge requests found
...@@ -38,9 +38,9 @@ class ChunksController < ApplicationController ...@@ -38,9 +38,9 @@ class ChunksController < ApplicationController
currentSize = params[:resumableChunkNumber].to_i * params[:resumableChunkSize].to_i currentSize = params[:resumableChunkNumber].to_i * params[:resumableChunkSize].to_i
filesize = params[:resumableTotalSize].to_i filesize = params[:resumableTotalSize].to_i
#When all chunks are uploaded
if (currentSize + params[:resumableCurrentChunkSize].to_i) >= filesize
#When all chunks are uploaded
if params[:resumableChunkNumber].to_i >= params[:resumableTotalChunks].to_i
#Create a target file #Create a target file
File.open(resumable_filename, "a") do |target| File.open(resumable_filename, "a") do |target|
#Loop trough the chunks #Loop trough the chunks
...@@ -58,7 +58,6 @@ class ChunksController < ApplicationController ...@@ -58,7 +58,6 @@ class ChunksController < ApplicationController
end end
puts "File saved to #{resumable_filename}" puts "File saved to #{resumable_filename}"
end end
publisher = LearningObjectPublisher.new(DspaceService.create_client) publisher = LearningObjectPublisher.new(DspaceService.create_client)
publisher.post @learning_object, resumable_filename publisher.post @learning_object, resumable_filename
end end
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment