Hi All:
I'm looking right way to extract attachment file in PUT request.
Here is sample CURL request from client:
So in above request I want to receive test.wav audio file.
Here is my little request parser to get other parameters:
RecvBody = Req:recv_body(),
Data = case RecvBody of
'>' -> erlang:list_to_binary("{}");
Bin -> Bin
end,
case catch mochijson2:decode(Data) of
{struct, Struct} -> Struct;
BadData -> [{}]
end.
It seems decode() call is decoding all data together.
Can you please point in right direction ? Any sample would be highly appreciated.
Thanks a lot.