add Horde_Controller_FileUpload
authorChuck Hagenbuch <chuck@horde.org>
Thu, 30 Apr 2009 15:10:49 +0000 (11:10 -0400)
committerChuck Hagenbuch <chuck@horde.org>
Thu, 30 Apr 2009 15:10:49 +0000 (11:10 -0400)
framework/Controller/lib/Horde/Controller/FileUpload.php [new file with mode: 0644]
framework/Controller/package.xml

diff --git a/framework/Controller/lib/Horde/Controller/FileUpload.php b/framework/Controller/lib/Horde/Controller/FileUpload.php
new file mode 100644 (file)
index 0000000..d283ca0
--- /dev/null
@@ -0,0 +1,39 @@
+<?php
+/**
+ * Copyright 2007 Maintainable Software, LLC
+ * Copyright 2008-2009 The Horde Project (http://www.horde.org/)
+ *
+ * @author     Mike Naberezny <mike@maintainable.com>
+ * @author     Derek DeVries <derek@maintainable.com>
+ * @author     Chuck Hagenbuch <chuck@horde.org>
+ * @license    http://opensource.org/licenses/bsd-license.php
+ * @category   Horde
+ * @package    Horde_Controller
+ */
+
+/**
+ * A file upload from multipart form
+ *
+ * @author     Mike Naberezny <mike@maintainable.com>
+ * @author     Derek DeVries <derek@maintainable.com>
+ * @author     Chuck Hagenbuch <chuck@horde.org>
+ * @license    http://opensource.org/licenses/bsd-license.php
+ * @category   Horde
+ * @package    Horde_Controller
+ */
+class Horde_Controller_FileUpload
+{
+    public $originalFilename = null;
+    public $length           = null;
+    public $contentType      = null;
+    public $path             = null;
+
+    public function __construct($options)
+    {
+        $this->originalFilename = isset($options['name'])     ? $options['name']     : null;
+        $this->length           = isset($options['size'])     ? $options['size']     : null;
+        $this->contentType      = isset($options['type'])     ? $options['type']     : null;
+        $this->path             = isset($options['tmp_name']) ? $options['tmp_name'] : null;
+    }
+
+}
index 0e47ffa..d0f91ca 100644 (file)
@@ -54,6 +54,7 @@ http://pear.php.net/dtd/package-2.0.xsd">
       <file name="Base.php" role="php" />
       <file name="Dispatcher.php" role="php" />
       <file name="Exception.php" role="php" />
+      <file name="FileUpload.php" role="php" />
       <file name="Scanner.php" role="php" />
       <file name="StatusCodes.php" role="php" />
       <file name="UrlWriter.php" role="php" />
@@ -77,6 +78,7 @@ http://pear.php.net/dtd/package-2.0.xsd">
    <install name="lib/Horde/Controller/Base.php" as="Horde/Controller/Base.php" />
    <install name="lib/Horde/Controller/Dispatcher.php" as="Horde/Controller/Dispatcher.php" />
    <install name="lib/Horde/Controller/Exception.php" as="Horde/Controller/Exception.php" />
+   <install name="lib/Horde/Controller/FileUpload.php" as="Horde/Controller/Exception.php" />
    <install name="lib/Horde/Controller/Scanner.php" as="Horde/Controller/Scanner.php" />
    <install name="lib/Horde/Controller/StatusCodes.php" as="Horde/Controller/StatusCodes.php" />
    <install name="lib/Horde/Controller/UrlWriter.php" as="Horde/Controller/UrlWriter.php" />