Skip to content

Commit

Permalink
Merge pull request #715 from ocsigen/fixupload
Browse files Browse the repository at this point in the history
[Eliom_request_info] Restore functions to access uploaded file info
  • Loading branch information
vouillon authored Sep 17, 2021
2 parents 7afb255 + 788a38d commit 8071825
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 1 deletion.
2 changes: 1 addition & 1 deletion opam
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
opam-version: "2.0"
name: "eliom"
version: "8.7.0"
version: "8.8.0"
maintainer: "dev@ocsigen.org"
authors: "dev@ocsigen.org"
synopsis: "Client/server Web framework"
Expand Down
3 changes: 3 additions & 0 deletions src/lib/eliom_request_info.server.ml
Original file line number Diff line number Diff line change
Expand Up @@ -331,6 +331,9 @@ let get_ri () =
get_ri_sp sp

let get_tmp_filename fi = fi.Ocsigen_extensions.tmp_filename
let get_filesize fi = fi.Ocsigen_extensions.filesize
let get_original_filename fi = fi.Ocsigen_extensions.raw_original_filename
let get_file_content_type fi = fi.file_content_type

let get_sitedata () =
find_sitedata "get_sitedata"
Expand Down
12 changes: 12 additions & 0 deletions src/lib/eliom_request_info.server.mli
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,18 @@ val get_previous_extension_error_code : unit -> int
(** returns the filename used by Ocsigen for the uploaded file. *)
val get_tmp_filename : Ocsigen_extensions.file_info -> string

(** returns the size of the uploaded file. *)
val get_filesize : Ocsigen_extensions.file_info -> int64

(** returns the name the file had on the client when it has been sent. *)
val get_original_filename : Ocsigen_extensions.file_info -> string

(** returns the content type sent by the browser with the file
(if any). *)
val get_file_content_type :
Ocsigen_extensions.file_info -> ((string * string) * (string * string) list) option


(** returns the root of the site. *)
val get_site_dir : unit -> Eliom_lib.Url.path

Expand Down

0 comments on commit 8071825

Please sign in to comment.