diff 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
line wrap: on
line diff
--- a/tests/blob.ur	Sat Apr 25 14:35:49 2009 -0400
+++ b/tests/blob.ur	Sat Apr 25 14:47:16 2009 -0400
@@ -1,9 +1,10 @@
 sequence s
-table t : { Id : int, Nam : option string, Data : blob, Desc : string }
+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) VALUES ({[id]}, {[fileName r.Data]}, {[fileData r.Data]}, {[r.Desc]}));
+    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>