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 | |
parent | df4a000b4c97378ccadbd1f94d9f930f87228b28 (diff) |
Initial support for blobs and upload
Diffstat (limited to 'tests')
-rw-r--r-- | tests/blob.ur | 22 | ||||
-rw-r--r-- | tests/blob.urp | 5 | ||||
-rw-r--r-- | tests/blob.urs | 1 |
3 files changed, 28 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> diff --git a/tests/blob.urp b/tests/blob.urp new file mode 100644 index 00000000..2c6be994 --- /dev/null +++ b/tests/blob.urp @@ -0,0 +1,5 @@ +debug +database dbname=blob +sql blob.sql + +blob diff --git a/tests/blob.urs b/tests/blob.urs new file mode 100644 index 00000000..6ac44e0b --- /dev/null +++ b/tests/blob.urs @@ -0,0 +1 @@ +val main : unit -> transaction page |