Skip to content
Tcl Source Code History Of Ticket 1096703fffffffffffffffffffffffffffffffff
Login

History Of Ticket 1096703fffffffffffffffffffffffffffffffff

Artifacts Associated With Ticket 1096703fffffffffffffffffffffffffffffffff

  1. Ticket change [b5bc7bf31b] (rid 125294) by dvrsn on 2005-01-05 20:19:04:

    1. assignee initialized to: "hobbs"
    2. cmimetype initialized to: "text/plain"
    3. comment initialized to:
      Not sure if this belongs here or in tcllib, but since
      http is part of the core I would think here.
      
      It is possible to post a mime message (the primary one
      of interest would be a multipart/form-data post) using
      http, but it is more complicated than it should be.  
      
      Suggested functionality: test the -query argument to
      http::geturl, if it is determined to be a mime token
      (produced by the mime package in tcllib) then use that
      to set the content-type and associated information
      (such as boundary) and extract the message from that
      token.  Alternately use a -mime argument to
      unambiguously invoke this functionality.  
      
      This probably requires additional support from the
      tcllib mime package, particularly a way to query the
      boundary string separately from the entire message.
      
    4. foundin initialized to: "None"
    5. priority initialized to: "5 Medium"
    6. resolution initialized to: "None"
    7. status initialized to: "Open"
    8. submitter initialized to: "dvrsn"
    9. subsystem initialized to: "29. http Package"
    10. title initialized to: "add mime support to http"
    11. type initialized to: "RFE"
  2. Ticket change [b52f0f999a] (rid 125195) by davidw on 2005-01-27 00:00:35:

    1. icomment:
      Logged In: YES 
      user_id=240
      
      I created the following helper functions (change the
      namespace if you want to use them), which work with http as
      it stands now.  It would probably be better to create a
      -multipart switch for geturl, as it would be simpler. 
      
      proc multipload::multipart-var {var val} {
          return "Content-Disposition: form-data;
      name=\"$var\";\r\n\r\n${val}\r\n"
      }
      
      proc multipload::multipart-file {var filename} {
          set fl [open $filename r]
          fconfigure $fl -translation binary
          set data [read $fl]
          close $fl
          return "Content-Disposition: form-data; name=\"${var}\";
      filename=\"${filename}\"\r\n\r\n$data\n"
      }
      
      proc multipload::multipart/form-data {queryvarname
      boundvarname parts} {
          upvar $queryvarname query
          upvar $boundvarname bound
      
          set bound "-----NEXT_PART_[clock seconds].[pid]"
      
          set result [join $parts "--${bound}\r\n"]
          set result "--${bound}\r\n${result}--${bound}--"
      
          set query $result
      }
      
      You can use them like so:
      
          multipart/form-data query bound [list [multipart-file
      fileupload $filename] \
       [multipart-var action upload]]
      
          set page [::http::geturl $url -type
      "multipart/form-data; boundary=$bound" \
        -query $query]
      
      
      
      Hope the formatting isn't too bad with SF...
      
      
      
    2. login: "davidw"
    3. mimetype: "text/plain"
    4. username: "davidw"
  3. Ticket change [eb0151f4a1] (rid 103465) by hobbs on 2008-03-12 16:41:58:

    1. closedate changed to: "2008-03-12T09:41:58"
    2. closer changed to: "hobbs"
    3. icomment:
      Logged In: YES 
      user_id=72656
      Originator: NO
      
      This looks very appropriate for tcllib.
      
      
    4. login: "hobbs"
    5. mimetype: "text/plain"
    6. resolution changed to: "Rejected"
    7. status changed to: "Closed"
    8. username: "hobbs"