WDialog API for Objective Caml: Wd_upload
module Wd_upload: sig .. end This module manages file upload parameters.
type upload_manager
Manages the file upload parameters of a certain request
val get : upload_manager -> string -> Netcgi_types.cgi_argument
Returns the CGI argument containing the file upload information for
the file upload box with the passed name. This name is what is
specified in the "name" attribute of ui:file.
See netcgi.mli for accessor functions for cgi_argument values.
This function raises Not_found if there is no ui:file box with
the passed name. This function returns a pseudo argument with
empty value, empty filename, and empty MIME type if the browser did
not send the corresponding CGI argument to the server. (Note:
At least Netscape browsers always send CGI arguments even if the
user did not specify files to upload, and these arguments
have empty value, empty filename, and empty MIME type. It is a
good idea to check for an empty filename in order to find out
whether the upload box was used or not.)
val init : Wd_types.environment -> Wd_types.interactors -> upload_manager
Scans the available CGI parameters for file uploads, and initializes
this module.
- It is required that the CGI module is already initialized
(in
environment )
- The argument of this function is the interactor definition of the
page that has been submitted.
|