How to read from post param?
问题 I need to parse text file. This file is in post param. I have code like this: upload_file('POST', []) -> File = Req:post_param("file"), What should I do next? How to parse it? 回答1: What's inside Req:post_param("file") ? You assume it's a path to a file: have you checked the value of File ? Anyway, it's Req:post_files/0 you are probably looking for: [{_, _FileName, TempLocation, _Size}|_] = Req:post_files(), {ok,Data} = file:read_file(TempLocation), It's also probably a Bad Idea to leave the