[AMG]: This page is for questions and answers about how to use the [Wibble] web server. Report bugs at [Wibble bugs]. <> ---- **Put your question here** [JM] 12Feb2012 - the file index.html.tmpl on the "image file upload, cookies, sessions" example on [Wibble examples] is somehow connected to the "image.script" file mentioned in step 3, how that works? [AMG]: image.script serves the images; that's all it does. I'll repeat it here, annotated with copious comments: ======tcl # If there is a sessionid cookie in the header, if {[dict exists $header cookie sessionid ""]} { # Link the local session variable to an element in the global session array. # The linked element is the one whose key is the same as the value stored in # the sessionid cookie. It's quite possible that the element doesn't exist, # but create the link anyway. upvar #0 sessions([dict get $header cookie sessionid ""]) session } # If: # 1. [info exists session]: there was a sessionid cookie, and there exists an # associated element in the global sessions array, # 2. [dict exists $session imagetype]: the imagetype dict element exists in # the value stored in the session variable, # 3. [dict exists $session imagedata]: and the imagedata dict element exists, if {[info exists session] && [dict exists $session imagetype] && [dict exists $session imagedata]} { # Serve the image to the client. Use the imagetype dict element as the HTTP # content-type, and use the imagedata dict element as the content. dict set response header content-type [dict get $session imagetype] dict set response content [dict get $session imagedata] } else { # But if any of that stuff wasn't true (e.g., no session data), 404 error. dict set response status 404 } ====== [JM] 13Mar2012 - Thanks for the explanation, what I do not understand is what is it triggering this code (i.e. I was expecting image.script to be part of the ACTION form so that whenever the submit button is clicked, such action is then triggered). I may be missing something basic, I appreciate your help. <> Wibble