summaryrefslogtreecommitdiff
path: root/tests/blob.ur
blob: 2d58faae6e9266a47d555026d11d5feb8278f580 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
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>