no way to save a file from cb_admin?
something like this (it's just an invention)
152 'POST' ->
153 Record = lists:foldr(fun
154 ('id', Acc) -> Acc:set(id, 'id');
155 (Attr, Acc) ->
156 AttrName = atom_to_list(Attr),
157 Val = Req:post_param(AttrName),
158 [{_, FileName, Location, Length}] =
Req:post_files(),
159 Val1 = case erlang:length(FileName)
> 0 of
160 true ->
161 Fname =
"./priv/static/" ++ FileName,
162 file:copy(Location,
Fname),
163 file:delete(Location
),
164 Fname;
165 _ -> Req:post_param(
AttrName)
166 end,
167 Acc:set(Attr, Val1)
168 end, DummyRecord, DummyRecord:
attribute_names()),
--
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/4ae9765b-c41c-4c39-93e2-9ca6cb851296%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.