From 8843c26153e6b98007b43c1ac98c844a1038b8b6 Mon Sep 17 00:00:00 2001 From: Ain <41307858+nero@users.noreply.github.com> Date: Fri, 16 Aug 2019 10:26:37 +0000 Subject: [PATCH] Provide pathname of uploaded file --- FileUpload.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/FileUpload.php b/FileUpload.php index a3a5133..d212766 100644 --- a/FileUpload.php +++ b/FileUpload.php @@ -10,4 +10,9 @@ class FileUpload extends FormField { $this->value=$_FILES[$name]['name']; $this->file=$_FILES[$name]['tmp_name']; } + + public function getTmpPath() { + if ($this->error > 0) throw new UploadException("Upload failure", $this->error); + return $this->file; + } }