grrwlf@2053: table t : { Id : int, Blob : blob, MimeType : string }
grrwlf@2053: sequence s
grrwlf@2053:
grrwlf@2053: fun getImage id : transaction page =
grrwlf@2053: r <- oneRow1 (SELECT t.Blob, t.MimeType
grrwlf@2053: FROM t
grrwlf@2053: WHERE t.Id = {[id]});
grrwlf@2053: returnBlob r.Blob (blessMime r.MimeType)
grrwlf@2053:
grrwlf@2053: fun handle (r : {File:file, Param:string}) =
grrwlf@2053: id <- nextval s;
grrwlf@2053: dml (INSERT INTO t (Id, Blob, MimeType)
grrwlf@2053: VALUES ({[id]}, {[fileData r.File]}, {[fileMimeType r.File]}));
grrwlf@2053: debug ("Text is " ^ r.Param);
grrwlf@2053: main ()
grrwlf@2053:
grrwlf@2053: and main () : transaction page =
grrwlf@2053: x <- queryX1 (SELECT t.Id FROM t)
grrwlf@2053: (fn r =>
grrwlf@2053: );
grrwlf@2053: return
grrwlf@2053:
grrwlf@2053:
grrwlf@2053: {x}
grrwlf@2053: