aboutsummaryrefslogtreecommitdiff
path: root/actions/photos/image/ajax_upload.php
diff options
context:
space:
mode:
authorSem <sembrestels@riseup.net>2012-07-29 04:13:33 +0200
committerSem <sembrestels@riseup.net>2012-07-29 04:13:33 +0200
commit7a9177c9df49d6fc02280df02d6e7f6d52531382 (patch)
tree518ecb9df491374faa1062fee2d32dca61ba74a3 /actions/photos/image/ajax_upload.php
parentf9e9c6cb5950ccf1d1d5396caa9dbb2803aacdad (diff)
parent24ff6662195222479b4d83d41fa89edc8a3c05d1 (diff)
downloadelgg-7a9177c9df49d6fc02280df02d6e7f6d52531382.tar.gz
elgg-7a9177c9df49d6fc02280df02d6e7f6d52531382.tar.bz2
Merge branch 'no-flash-uploader' of git://github.com/sembrestels/Tidypics
Diffstat (limited to 'actions/photos/image/ajax_upload.php')
-rw-r--r--actions/photos/image/ajax_upload.php57
1 files changed, 0 insertions, 57 deletions
diff --git a/actions/photos/image/ajax_upload.php b/actions/photos/image/ajax_upload.php
deleted file mode 100644
index 312bc598c..000000000
--- a/actions/photos/image/ajax_upload.php
+++ /dev/null
@@ -1,57 +0,0 @@
-<?php
-/**
- * Elgg single upload action for flash/ajax uploaders
- */
-
-elgg_load_library('tidypics:upload');
-
-$album_guid = (int) get_input('album_guid');
-$file_var_name = get_input('file_var_name', 'Image');
-$batch = get_input('batch');
-
-$album = get_entity($album_guid);
-if (!$album) {
- echo elgg_echo('tidypics:baduploadform');
- exit;
-}
-
-// probably POST limit exceeded
-if (empty($_FILES)) {
- trigger_error('Tidypics warning: user exceeded post limit on image upload', E_USER_WARNING);
- register_error(elgg_echo('tidypics:exceedpostlimit'));
- exit;
-}
-
-$file = $_FILES[$file_var_name];
-
-$mime = tp_upload_get_mimetype($file['name']);
-if ($mime == 'unknown') {
- echo 'Not an image';
- exit;
-}
-
-// we have to override the mime type because uploadify sends everything as application/octet-string
-$file['type'] = $mime;
-
-$image = new TidypicsImage();
-$image->container_guid = $album->getGUID();
-$image->setMimeType($mime);
-$image->access_id = $album->access_id;
-$image->batch = $batch;
-
-try {
- $image->save($file);
- $album->prependImageList(array($image->guid));
-
- if (elgg_get_plugin_setting('img_river_view', 'tidypics') === "all") {
- add_to_river('river/object/image/create', 'create', $image->getOwnerGUID(), $image->getGUID());
- }
-
- echo elgg_echo('success');
-} catch (Exception $e) {
- // remove the bits that were saved
- $image->delete();
- echo $e->getMessage();
-}
-
-exit; \ No newline at end of file