[erlang-questions] COWBOY

Theepan <>
Sun Jan 24 13:44:09 CET 2016


That makes sense. Thanks.

Regards,
Theepan

On Sun, Jan 24, 2016 at 2:31 AM, Loïc Hoguin <> wrote:

> Nothing automatic.
>
> It's like this so you can process on the fly and avoid having a gigabyte
> file in memory.
>
>
> On 01/23/2016 09:32 PM, Theepan wrote:
>
>> Team,
>>
>> The following is the code fragment to read the body of a multipart data
>> (as per the documentation), when it is the contents of a uploaded file.
>>
>> stream_file(Req) ->
>>    case cowboy_req:part_body(Req) of
>>      {ok, Body, Req2} ->
>>        {ok, Body, Req2};
>>      {more, Body, Req2} ->
>>        stream_file(Req2)
>>    end.
>>
>> The question is, when the {more, Body, Req2} case clause is reached,
>> should the 'Body' need to get concatenated like <<OldBody/binary,
>> Body/binary>>, OR when looped, the library collects the next pieces of
>> chunks into the 'Body' automatically?
>>
>> Thanks,
>> Theepan
>>
>>
>> _______________________________________________
>> erlang-questions mailing list
>> 
>> http://erlang.org/mailman/listinfo/erlang-questions
>>
>>
> --
> Loïc Hoguin
> http://ninenines.eu
> Author of The Erlanger Playbook,
> A book about software development using Erlang
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20160124/ccf050aa/attachment.html>


More information about the erlang-questions mailing list