anchor.diff:      ChunkSize = PartsNumber*PartSize,
       ParamsProp = [{<<"resumableIdentifier">>, <<"id">>}, {<<"parentId">>, ParentGuid},
           {<<"resumableFilename">>, FileName}, {<<"resumableChunkSize">>, integer_to_binary(ChunkSize)}],
  -    
  +
       utils:pforeach(fun(Chunk) ->
  -        rpc:call(Worker, page_file_upload, multipart, [#{size => PartSize, left => PartsNumber}, SessionId, 
  +        rpc:call(Worker, page_file_upload, multipart, [#{size => PartSize, left => PartsNumber}, SessionId,
               [{<<"resumableChunkNumber">>, integer_to_binary(Chunk)} | ParamsProp]])
       end, lists:seq(1,ChunksNumber)).
   
  
positive.code: replicate_file_smaller_than_quota_should_not_fail(Config) ->
      #env{p1 = P1, p2 = P2, file1 = File1} =
          gen_test_env(Config),
      SessId = fun(Worker) -> ?config({session_id, {<<"user1">>, ?GET_DOMAIN(Worker)}}, Config) end,
      
      {ok, Guid} = create_file(P1, SessId(P1), f(<<"space3">>, File1)),
      ?assertMatch({ok, _}, write_to_file(P1, SessId(P1), f(<<"space3">>, File1), 0, crypto:strong_rand_bytes(20))),
      {ok, Tid} = lfm_proxy:schedule_file_replication(P1, SessId(P1), {guid, Guid}, ?GET_DOMAIN_BIN(P2)),
      
      % wait for replication to finish
      ?assertMatch({ok, []}, rpc:call(P1, transfer, list_waiting_transfers, [<<"space_id3">>]), ?ATTEMPTS),
      ?assertMatch({ok, []}, rpc:call(P1, transfer, list_ongoing_transfers, [<<"space_id3">>]), ?ATTEMPTS),
      ?assertEqual(true, lists:member(Tid, list_ended_transfers(P1, <<"space_id3">>)), ?ATTEMPTS),
      
      ?assertMatch({ok, [#{<<"totalBlocksSize">> := 20}, #{<<"totalBlocksSize">> := 20}]}, 
          lfm_proxy:get_file_distribution(P2, SessId(P2), {guid, Guid}), 30),
  
      ok = fsync(P2, SessId(P2), f(<<"space3">>, File1)),
      ?assertEqual(20, current_size(P1, <<"space_id3">>), ?ATTEMPTS),
  
negative.code:         gen_test_env(Config),
  
      {ok, #file_attr{guid = Guid}} = lfm_proxy:stat(P1, User1, {path, <<"/space4">>}),
  
      FileSize = 500*1024*1024, % 500 MB
  
      ProviderId = initializer:domain_to_provider_id(?GET_DOMAIN(P1)),
      % Upload File1 500MB to space4
      do_multipart(P1, User1, 100, 1048576, 5, Guid, File1),
  
      {ok, FileHandle} = lfm_proxy:open(P1, User1, f(<<"space4">>, File1), rdwr),
      ok = lfm_proxy:fsync(P1, FileHandle),
      ?assertMatch(FileSize, current_size(P1, <<"space_id4">>)),
  
      % Upload File2 800MB to space4
      do_multipart(P1, User1, 160, 1048576, 5, Guid, File2),
      ok = lfm_proxy:fsync(P1, User1, f(<<"space4">>, File2), ProviderId),
  