summaryrefslogtreecommitdiffstats
path: root/application/controllers/file.php
diff options
context:
space:
mode:
authorFlorian Pritz <bluewind@xinu.at>2011-06-06 16:01:33 +0200
committerFlorian Pritz <bluewind@xinu.at>2011-06-06 16:01:33 +0200
commit606012e782af20f00b7b19a08e924e07c34d7ec5 (patch)
treee31deecd76452cf381b3802991fc8c4b3a911e6f /application/controllers/file.php
parentc19a41faa3c81a7670b9f9e0c621c2254f7068f7 (diff)
use javascript to allow text pastes
The javascript converts the content of the textarea to a HTTP POST request and sends the text as a file upload. Signed-off-by: Florian Pritz <bluewind@xinu.at>
Diffstat (limited to 'application/controllers/file.php')
-rw-r--r--application/controllers/file.php6
1 files changed, 6 insertions, 0 deletions
diff --git a/application/controllers/file.php b/application/controllers/file.php
index fb219f67f..f1a4d6c08 100644
--- a/application/controllers/file.php
+++ b/application/controllers/file.php
@@ -164,6 +164,12 @@ class File extends CI_Controller {
function do_upload()
{
$data = array();
+
+ if ($this->uri->segment(3)) {
+ $this->var->cli_client = true;
+ $this->var->view_dir = "file_plaintext";
+ }
+
$extension = $this->input->post('extension');
if(!isset($_FILES['file']) || $_FILES['file']['error'] !== 0) {
$this->output->set_status_header(400);