Discussion:
How to download files in ChicagoBoss?
Caiyun Deng
2014-08-27 02:56:58 UTC
Permalink
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 chicagoboss+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/***@public.gmane.org
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
2014-08-27 03:16:31 UTC
Permalink
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
Post by Caiyun Deng
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
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 chicagoboss+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/***@public.gmane.org
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.
Caiyun Deng
2014-08-27 07:10:33 UTC
Permalink
Thanks!

圚 2014幎8月27日星期䞉UTC+8䞊午11时16分54秒Jesse Gumm写道
Post by Jesse Gumm
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
Post by Caiyun Deng
Hi!
I know how to upload file in ChicagoBoss.
But how to download file in ChicagoBoss I want to show the file button
in
Post by Caiyun Deng
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
Post by Caiyun Deng
"ChicagoBoss" group.
To unsubscribe from this group and stop receiving emails from it, send
an
Post by Caiyun Deng
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.
Post by Caiyun Deng
For more options, visit https://groups.google.com/d/optout.
--
Jesse Gumm
Owner, Sigma Star Systems
--
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 chicagoboss+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/***@public.gmane.org
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/d62139f0-4e43-4b7b-a144-3aebe93719ad%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Loading...