diff options
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> |