summaryrefslogtreecommitdiff
path: root/core/controllers/simple_uploader.php
diff options
context:
space:
mode:
authorBharat Mediratta <bharat@menalto.com>2009-02-25 05:27:29 +0000
committerBharat Mediratta <bharat@menalto.com>2009-02-25 05:27:29 +0000
commit515c081f794c0e020241956f291381361e28489a (patch)
tree3c1f4a153d046db9f3a4a39df4954bbc33a227f1 /core/controllers/simple_uploader.php
parent585ea819579405bbfe772d2e7fa647f54d5a17e2 (diff)
Add support MP4 movies also. Flowplayer supports them and can stream
them using the h264streaming plugin. Everything else is a fairly minor change.
Diffstat (limited to 'core/controllers/simple_uploader.php')
-rw-r--r--core/controllers/simple_uploader.php14
1 files changed, 7 insertions, 7 deletions
diff --git a/core/controllers/simple_uploader.php b/core/controllers/simple_uploader.php
index 4e2be4c8..b56bce16 100644
--- a/core/controllers/simple_uploader.php
+++ b/core/controllers/simple_uploader.php
@@ -46,19 +46,19 @@ class Simple_Uploader_Controller extends Controller {
access::verify_csrf();
$file_validation = new Validation($_FILES);
- $file_validation->add_rules("file", "upload::valid", "upload::type[gif,jpg,png,flv]");
+ $file_validation->add_rules("file", "upload::valid", "upload::type[gif,jpg,png,flv,mp4]");
if ($file_validation->validate()) {
- $temp_filename = upload::save("file");
+ $temp_filename = upload::save("file");
$title = substr(basename($temp_filename), 10); // Skip unique identifier Kohana adds
$path_info = pathinfo($temp_filename);
- if ($path_info["extension"] == "flv") {
+ if (in_array(strtolower($path_info["extension"]), array("flv", "mp4"))) {
$movie = movie::create($album, $temp_filename, $title, $title);
- log::success("content", t("Added a movie"), html::anchor("movies/$movie->id",
- t("view movie")));
+ log::success("content", t("Added a movie"),
+ html::anchor("movies/$movie->id", t("view movie")));
} else {
$photo = photo::create($album, $temp_filename, $title, $title);
- log::success("content", t("Added a photo"), html::anchor("photos/$photo->id",
- t("view photo")));
+ log::success("content", t("Added a photo"),
+ html::anchor("photos/$photo->id", t("view photo")));
}
}
}