Mercurial > urweb
view tests/blob.ur @ 741:f7e2026dd5ae
Returning a blob as page result
author | Adam Chlipala <adamc@hcoop.net> |
---|---|
date | Sun, 26 Apr 2009 09:02:17 -0400 |
parents | b302b6e35f93 |
children | 43553c93dd8c |
line wrap: on
line source
sequence s table t : { Id : int, Nam : option string, Data : blob, Desc : string, Typ : string } fun save r = id <- nextval s; dml (INSERT INTO t (Id, Nam, Data, Desc, Typ) VALUES ({[id]}, {[fileName r.Data]}, {[fileData r.Data]}, {[r.Desc]}, {[fileMimeType r.Data]})); main () and main () = return <xml><body> <form> <textbox{#Desc}/> <upload{#Data}/> <submit action={save}/> </form> </body></xml>