view tests/blob.ur @ 739:4bb7e1c0550a

Only allow single-file upload per control
author Adam Chlipala <adamc@hcoop.net>
date Sat, 25 Apr 2009 14:35:49 -0400
parents d049d31a1966
children b302b6e35f93
line wrap: on
line source
sequence s
table t : { Id : int, Nam : option string, Data : blob, Desc : string }

fun save r =
    id <- nextval s;
    dml (INSERT INTO t (Id, Nam, Data, Desc) VALUES ({[id]}, {[fileName r.Data]}, {[fileData r.Data]}, {[r.Desc]}));
    main ()

and main () = return <xml><body>
  <form>
    <textbox{#Desc}/>
    <upload{#Data}/>
    <submit action={save}/>
  </form>
</body></xml>