anchor.diff:              Req,
               Etag,
               fun() ->
  -                {ok, Resp} = start_chunked_response(Req, 200, Headers),
  -                AttFun(Att, fun(Seg, _) -> send_chunk(Resp, Seg) end, ok),
  -                last_chunk(Resp)
  +                case Len of
  +                undefined ->
  +                    {ok, Resp} = start_chunked_response(Req, 200, Headers),
  +                    AttFun(Att, fun(Seg, _) -> send_chunk(Resp, Seg) end, ok),
  +                    last_chunk(Resp);
  +                _ ->
  +                    {ok, Resp} = start_response_length(Req, 200, Headers, Len),
  +                    AttFun(Att, fun(Seg, _) -> send(Resp, Seg) end, ok)
  +                end
               end
           )
       end;
  
positive.code:         _ ->
              []
          end,
          AttFun = case ReqAcceptsAttEnc of
          false ->
              fun couch_doc:att_foldl_decode/3;
  
negative.code:     case [A || A <- Atts, A#att.name == FileName] of
      [] ->
          throw({not_found, "Document is missing attachment"});
      [#att{type=Type, encoding=Enc, disk_len=DiskLen, att_len=AttLen}=Att] ->
          Etag = couch_httpd:doc_etag(Doc),
          ReqAcceptsAttEnc = lists:member(
             atom_to_list(Enc),
  