The easy way is to put your uploaded files into a directory in
/priv/static then any requests to
http://yoursite.com/static/some/path/your_new_file.bin
Otherwise, if your files are small, you could just have a controller
return {output, FileContents, Headers}, where FileContents could be
the result of file:read_file/1
(http://erldocs.com/17.0/kernel/file.html?i=0&search=file:read_file#read_file/1)
Ooootherwise, if your files are large, you can write a generator
function and return a streaming with with {stream, GeneratorFun, Acc}
(see http://chicagoboss.org/api-controller.html)
Hope that helps,
-Jesse
On Tue, Aug 26, 2014 at 9:56 PM, Caiyun Deng <[email protected]> wrote:
> Hi!
> I know how to upload file in ChicagoBoss.
> But how to download file in ChicagoBoss? I want to show the file button in
> the page, and click the file then it will download the file.
> Thanks!
>
> --
> You received this message because you are subscribed to the Google Groups
> "ChicagoBoss" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> Visit this group at http://groups.google.com/group/chicagoboss.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/chicagoboss/658e5727-2a37-4e1a-8e31-e05e6c13b5b3%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
--
Jesse Gumm
Owner, Sigma Star Systems
414.940.4866 || sigma-star.com || @jessegumm
--
You received this message because you are subscribed to the Google Groups
"ChicagoBoss" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
Visit this group at http://groups.google.com/group/chicagoboss.
To view this discussion on the web visit
https://groups.google.com/d/msgid/chicagoboss/CAPTXyXcBkHpxdGN_LO8EHt9y0z5_M2UuK8%2Bq0UgeLfu1Jt0sNg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.