app/controllers/concerns/deposit_data.rb
# given a chunk of a local file and a relative path for where it should, write the chunk to the correct place in the temporary deposit 
given a chunk of a local file and a relative path for where it should, write the chunk to the correct place in the temporary deposit
given a chunk of a local file and a relative path for where it should write the chunk to the correct place in the temporary deposit
def deposit_file_chunk_from_client(filechunk, path, dataset_id, size, first)
    uploaded_filename = path.empty? ? filechunk.original_filename : path
    if !request.env["HTTP_CONTENT_RANGE"] or request.env["HTTP_CONTENT_RANGE"].starts_with?("bytes 0-")
      write_mode = 'wb'
      if first
        delete_deposited_files(dataset_id)
      end
    else
      write_mode = 'ab'
    end
    write_deposit_chunk(filechunk.read, uploaded_filename, dataset_id, size, write_mode)
  end
def deposit_file_chunk_from_client ( filechunk , path , dataset_id , size , first ) uploaded_filename = path . empty? ? filechunk . original_filename : path if ! request . env [ "HTTP_CONTENT_RANGE" ] or request . env [ "HTTP_CONTENT_RANGE" ] . starts_with? ( "bytes 0-" ) write_mode = 'wb' if first delete_deposited_files ( dataset_id ) end else write_mode = 'ab' end write_deposit_chunk ( filechunk . read , uploaded_filename , dataset_id , size , write_mode ) end
given a chunk of a local file and a relative path for where it should, write the chunk to the correct place in the temporary deposit
given a chunk of a local file and a relative path for where it should write the chunk to the correct place in the temporary deposit
# if this is a chunked upload and this is the first chunk then we want to write a new file, else we want to append # if this is the first file uploaded then delete all existing uploaded files for this dataset before uploading these files
filechunk
<not_specific>
path
<not_specific>
dataset_id
<not_specific>
size
<not_specific>
first
<not_specific>