         <upload-image-action> "upload-image" add-responder
         <uploaded-image-action> "uploaded-image" add-responder ;
 
+initialize-image-directory
+<imagebin> main-responder set-global


: <uploaded-image-action> ( -- action )
    <page-action>
        { imagebin "uploaded-image" } >>template ;

SYMBOL: my-post-data
: <upload-image-action> ( -- action )
    <page-action>
        { imagebin "upload-image" } >>template
        [
            
            ! request get post-data>> my-post-data set-global
            ! image new
            !    "file" value
                ! insert-tuple
            "uploaded-image" <redirect>
        ] >>submit ;

: <imagebin> ( -- responder )
    imagebin new-dispatcher

! Copyright (C) 2008 Doug Coleman.
! See http://factorcode.org/license.txt for BSD license.
USING: accessors db db.tuples db.types furnace.actions
furnace.redirection html.forms http http.server
http.server.dispatchers io.directories io.pathnames kernel
multiline namespaces urls ;
IN: webapps.imagebin

SYMBOL: image-directory

image-directory [ "resource:images" ] initialize

TUPLE: imagebin < dispatcher ;

