comparison tests/blob.ur @ 740:b302b6e35f93

Add MIME type to file
author Adam Chlipala <adamc@hcoop.net>
date Sat, 25 Apr 2009 14:47:16 -0400
parents 4bb7e1c0550a
children 43553c93dd8c
comparison
equal deleted inserted replaced
739:4bb7e1c0550a 740:b302b6e35f93
1 sequence s 1 sequence s
2 table t : { Id : int, Nam : option string, Data : blob, Desc : string } 2 table t : { Id : int, Nam : option string, Data : blob, Desc : string, Typ : string }
3 3
4 fun save r = 4 fun save r =
5 id <- nextval s; 5 id <- nextval s;
6 dml (INSERT INTO t (Id, Nam, Data, Desc) VALUES ({[id]}, {[fileName r.Data]}, {[fileData r.Data]}, {[r.Desc]})); 6 dml (INSERT INTO t (Id, Nam, Data, Desc, Typ)
7 VALUES ({[id]}, {[fileName r.Data]}, {[fileData r.Data]}, {[r.Desc]}, {[fileMimeType r.Data]}));
7 main () 8 main ()
8 9
9 and main () = return <xml><body> 10 and main () = return <xml><body>
10 <form> 11 <form>
11 <textbox{#Desc}/> 12 <textbox{#Desc}/>