Welcome Guest, Not a member yet? Register   Sign In
codeigniter $_FILES upload
#1
Video 

In Codeigniter syntax for normal PHP code $_POST['name'] is $this->input->post('name'). Does anyone knows what is syntax in CI for $_FILES['file']?

I don't want to upload, I want to catch file and make some action before uploading. In upload helper is only this: $this->upload->do_upload('file') - and that is uploading. I want to manage file before this step.

Thanks in advance
Reply
#2

There is no special "syntax" for accessing $_FILES, nor is there a way to interact with any such file before it is uploaded.

There's also no particularly good reason to choose input->post() over $_POST.
Reply
#3

(06-08-2016, 11:11 AM)Narf Wrote: There is no special "syntax" for accessing $_FILES, nor is there a way to interact with any such file before it is uploaded.

There's also no particularly good reason to choose input->post() over $_POST.

I think with input->post() I will avoid XSS.
Reply
#4

(06-08-2016, 01:07 PM)vladakg Wrote:
(06-08-2016, 11:11 AM)Narf Wrote: There is no special "syntax" for accessing $_FILES, nor is there a way to interact with any such file before it is uploaded.

There's also no particularly good reason to choose input->post() over $_POST.

I think with input->post() I will avoid XSS.

input->post() does not avoid xss, unless told explicitly.

input->post() only replaces: isset($_POST['something']) ? $_POST['something'] : NULL;

https://codeigniter.com/user_guide/libra...erver-data
Reply
#5

$this->input->post('some_data', TRUE);

But I set $config['global_xss_filtering'] to TRUE.
Reply
#6

You only need to use one or the other not both.
What did you Try? What did you Get? What did you Expect?

Joined CodeIgniter Community 2009.  ( Skype: insitfx )
Reply
#7

(06-11-2016, 02:15 AM)vladakg Wrote: $this->input->post('some_data', TRUE);

You can replace this with xss_clean($_POST['some_data'])

(06-11-2016, 02:15 AM)vladakg Wrote: But I set $config['global_xss_filtering'] to TRUE.

This is bad and deprecated.
Reply




Theme © iAndrew 2016 - Forum software by © MyBB