From 606012e782af20f00b7b19a08e924e07c34d7ec5 Mon Sep 17 00:00:00 2001 From: Florian Pritz Date: Mon, 6 Jun 2011 16:01:33 +0200 Subject: 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 --- application/controllers/file.php | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'application/controllers/file.php') 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); -- cgit v1.2.3-24-g4f1b