anchor.diff:                      RequestedFullPath = gui_str:binary_to_unicode_list(filename:absname(Filename, TargetDir)),
                       FullPath = ensure_unique_filename(RequestedFullPath, 0),
                       try
  -                        stream_file_to_fslogic(Req, FullPath, get_upload_buffer_size())
  +                        stream_file_to_fslogic(Req2, FullPath, get_upload_buffer_size())
                       catch Type:Message ->
                           logical_files_manager:delete(FullPath),
                           throw({"Error in parse_file", Type, Message})
  
positive.code: % parses a multipart data POST request and write its data to a file
  % at specified path
  parse_rest_upload(Req, Path) ->
      Part = try multipart_data(Req) catch _:_ -> {false, Req} end,
      case Part of
          {eof, NewReq} ->
              {true, NewReq};
          {headers, Headers, NewReq} ->
              case (length(Headers) == 1) of
                  true -> {true, NewReq};
                  false -> NewReq2 = try
                      stream_file_to_fslogic(NewReq, Path, get_upload_buffer_size())
                                     catch _:_ ->
                                         logical_files_manager:delete(Path),
                                         {false, NewReq}
                                     end,
                      {true, NewReq2}
              end;
          _ -> {false, Req}
      end.
  
  % try to create empty file at specified path if it doesn't exist
  % or truncate its size to 0 if it exists and "overwrite" is set
  
negative.code:     end.
  
  %% ====================================================================
  %% INTERNAL FUNCTIONS - HTTP upload handling
  %% ====================================================================
  
  %% handle_rest_upload/3
  %% ====================================================================
  %% @doc Parses a multipart data POST request and returns set of field values and
  %% filenames of files that were successfully uploaded.
  %% @end
  -spec parse_multipart(Req :: req(), Params :: [tuple()], Files :: [tuple()]) -> {ok, Params :: [tuple()], Files :: [tuple()]}.
  %% ====================================================================
  parse_multipart(Req, Params, Files) ->
      case cowboy_req:part(Req) of
          {ok, Headers, Req2} ->
  