diff options
author | Adam Chlipala <adamc@hcoop.net> | 2009-04-25 13:59:11 -0400 |
---|---|---|
committer | Adam Chlipala <adamc@hcoop.net> | 2009-04-25 13:59:11 -0400 |
commit | e6ee37d85ac1e6fa7e2d20fc4320b89129b58ac1 (patch) | |
tree | 780df82b8252d17fbc6a6f3dc7b66ba2c6e5fb41 /tests/blob.ur | |
parent | df4a000b4c97378ccadbd1f94d9f930f87228b28 (diff) |
Initial support for blobs and upload
Diffstat (limited to 'tests/blob.ur')
-rw-r--r-- | tests/blob.ur | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/tests/blob.ur b/tests/blob.ur new file mode 100644 index 00000000..a62eefc1 --- /dev/null +++ b/tests/blob.ur @@ -0,0 +1,22 @@ +sequence s +table t : { Id : int, Nam : option string, Data : blob, Desc : string } + +fun save r = + if numFiles r.Data <> 1 then + error <xml>Please submit exactly one file.</xml> + else + let + val f = fileNum r.Data 0 + in + id <- nextval s; + dml (INSERT INTO t (Id, Nam, Data, Desc) VALUES ({[id]}, {[fileName f]}, {[fileData f]}, {[r.Desc]})); + main () + end + +and main () = return <xml><body> + <form> + <textbox{#Desc}/> + <upload{#Data}/> + <submit action={save}/> + </form> +</body></xml> |