Post multipart (Uploading file) with ocamlnet

Pierre-Alexandre Voye <[email protected]> Mon, 12 Dec 2011 18:53:52 +0100
Newsgroups gmane.comp.lang.ocaml.lib.net.devel
Message-ID <CANnJ5GerMMeZROkpC669aOwxki459uk4EHDQYC7fg7FwCYyytg@mail.gmail.com>
Hello,

I'm trying to finding my path to uploading a file via HTTP/POST, by parsing
a multipart form data, and i have to admit i'm lost.

I start from a netcgi, which with i can handle argument
let process (cgi : Netcgi.cgi_activation) =
  try
    let out = cgi # output # output_string in
                match cgi#request_method with
                | `POST ->       let t = cgi#environment#input_header()
in out "rrrhh"
    cgi # output # commit_work();
  with
      error ->    print_endline "toto"
;;

As far as i understand, i have to get the raw data, and to parse it with
Netmime module,
so my value "t" which contains cgi#environment#input_header() would
contains interesting data, but the type Netmime.mime_header only provide
methods to modify data..

Does anyone could give a hook to find a path ?

Thank you very much,

Regards,

P-A



-- 
---------------------
https://twitter.com/#!/ontologiae/
http://linuxfr.org/users/montaigne

------------------------------------------------------------------------------
Learn Windows Azure Live!  Tuesday, Dec 13, 2011
Microsoft is holding a special Learn Windows Azure training event for 
developers. It will provide a great way to learn Windows Azure and what it 
provides. You can attend the event by watching it streamed LIVE online.  
Learn more at http://p.sf.net/sfu/ms-windowsazure

_______________________________________________
Ocamlnet-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ocamlnet-devel