anchor.diff:  %% You can limit the size of the chunks being returned by using the
   %% first argument which is the size in bytes. It defaults to 1000000 bytes.
   -spec stream_body(non_neg_integer(), Req) -> {ok, binary(), Req}
  -    | {done, Req} | {error, atom()} when Req::req().
  -stream_body(MaxLength, Req=#http_req{body_state=waiting, version=Version,
  -        transport=Transport, socket=Socket}) ->
  +| {done, Req} | {error, atom()} when Req :: req().
  +stream_body(MaxLength, Req = #http_req{body_state = waiting, version = Version,
  +    transport = Transport, socket = Socket}) ->
       {ok, ExpectHeader, Req1} = cowboy_req:parse_header(<<"expect">>, Req),
       case ExpectHeader of
           [<<"100-continue">>] ->
               HTTPVer = atom_to_binary(Version, latin1),
               Transport:send(Socket,
  -                << HTTPVer/binary, " ", (<<"100 Continue">>)/binary, "\r\n\r\n" >>);
  +                <<HTTPVer/binary, " ", (<<"100 Continue">>)/binary, "\r\n\r\n">>);
           undefined ->
               ok
       end,
       case cowboy_req:parse_header(<<"transfer-encoding">>, Req1) of
           {ok, [<<"chunked">>], Req2} ->
  -            stream_body(MaxLength, Req2#http_req{body_state=
  -                {stream, 0,
  -                    fun cowboy_http:te_chunked/2, {0, 0},
  -                    fun cowboy_http:ce_identity/1}});
  +            stream_body(MaxLength, Req2#http_req{body_state =
  +            {stream, 0,
  +                fun cowboy_http:te_chunked/2, {0, 0},
  +                fun cowboy_http:ce_identity/1}});
           {ok, [<<"identity">>], Req2} ->
               {Length, Req3} = cowboy_req:body_length(Req2),
               case Length of
                   0 ->
  -                    {done, Req3#http_req{body_state=done}};
  +                    {done, Req3#http_req{body_state = done}};
                   Length ->
  -                    stream_body(MaxLength, Req3#http_req{body_state=
  -                        {stream, Length,
  -                            fun cowboy_http:te_identity/2, {0, Length},
  -                            fun cowboy_http:ce_identity/1}})
  +                    stream_body(MaxLength, Req3#http_req{body_state =
  +                    {stream, Length,
  +                        fun cowboy_http:te_identity/2, {0, Length},
  +                        fun cowboy_http:ce_identity/1}})
               end
       end;
  -stream_body(_, Req=#http_req{body_state=done}) ->
  +stream_body(_, Req = #http_req{body_state = done}) ->
       {done, Req};
  -stream_body(_, Req=#http_req{buffer=Buffer})
  -        when Buffer =/= <<>> ->
  -    transfer_decode(Buffer, Req#http_req{buffer= <<>>});
  +stream_body(_, Req = #http_req{buffer = Buffer})
  +    when Buffer =/= <<>> ->
  +    transfer_decode(Buffer, Req#http_req{buffer = <<>>});
   stream_body(MaxLength, Req) ->
       stream_body_recv(MaxLength, Req).
   
   -spec stream_body_recv(non_neg_integer(), Req)
  -    -> {ok, binary(), Req} | {error, atom()} when Req::req().
  -stream_body_recv(MaxLength, Req=#http_req{
  -        transport=Transport, socket=Socket, buffer=Buffer,
  -        body_state={stream, Length, _, _, _}}) ->
  +            -> {ok, binary(), Req} | {error, atom()} when Req :: req().
  +stream_body_recv(MaxLength, Req = #http_req{
  +        transport = Transport, socket = Socket, buffer = Buffer,
  +        body_state = {stream, Length, _, _, _}}) ->
       %% @todo Allow configuring the timeout.
       case Transport:recv(Socket, min(Length, MaxLength), ?UPLOAD_PART_TIMEOUT) of
  -        {ok, Data} -> transfer_decode(<< Buffer/binary, Data/binary >>,
  -            Req#http_req{buffer= <<>>});
  -        {error, Reason} -> 
  +        {ok, Data} -> transfer_decode(<<Buffer/binary, Data/binary>>,
  +            Req#http_req{buffer = <<>>});
  +        {error, Reason} ->
               lager:error("Cannot recv upload part data with len: ~p due to: ~p", [min(Length, MaxLength), Reason]),
               {error, Reason}
       end.
   
   -spec transfer_decode(binary(), Req)
  -    -> {ok, binary(), Req} | {error, atom()} when Req::req().
  -transfer_decode(Data, Req=#http_req{body_state={stream, _,
  -        TransferDecode, TransferState, ContentDecode}}) ->
  +            -> {ok, binary(), Req} | {error, atom()} when Req :: req().
  +transfer_decode(Data, Req = #http_req{body_state = {stream, _,
  +    TransferDecode, TransferState, ContentDecode}}) ->
       case TransferDecode(Data, TransferState) of
           {ok, Data2, Rest, TransferState2} ->
               content_decode(ContentDecode, Data2,
  -                Req#http_req{buffer=Rest, body_state={stream, 0,
  -                TransferDecode, TransferState2, ContentDecode}});
  -        %% @todo {header(s) for chunked
  +                Req#http_req{buffer = Rest, body_state = {stream, 0,
  +                    TransferDecode, TransferState2, ContentDecode}});
  +    %% @todo {header(s) for chunked
           more ->
  -            stream_body_recv(0, Req#http_req{buffer=Data, body_state={stream,
  +            stream_body_recv(0, Req#http_req{buffer = Data, body_state = {stream,
                   0, TransferDecode, TransferState, ContentDecode}});
           {more, Length, Data2, TransferState2} ->
               content_decode(ContentDecode, Data2,
  -                Req#http_req{body_state={stream, Length,
  -                TransferDecode, TransferState2, ContentDecode}});
  +                Req#http_req{body_state = {stream, Length,
  +                    TransferDecode, TransferState2, ContentDecode}});
           {done, Length, Rest} ->
               Req2 = transfer_decode_done(Length, Rest, Req),
               {done, Req2};
  
positive.code:         {more, Binary, NewReq} ->
              write_to_file(Binary, FullPath),
              stream_file_to_fslogic(NewReq, FullPath, BufferSize)
      end. 
  
  
  % Accumulates a whole buffer of multipart data with use of cowboy's multipart_data function
  
negative.code: 
  ensure_unique_filename(RequestedPath, Counter) ->
      Ext = filename:extension(RequestedPath),
      Rootname = filename:rootname(RequestedPath),
      NewName = lists:flatten(io_lib:format("~s(~B)~s", [Rootname, Counter, Ext])),
      case logical_files_manager:create(NewName) of
          ok -> NewName;
  