CI_Upload::do_upload()

do_upload([$field = 'userfile'])

Parameters:
  • $field (string) – Name of the form field
Returns:

TRUE on success, FALSE on failure

Return type:

bool

Performs the upload based on the preferences you’ve set.

Note

By default the upload routine expects the file to come from a form field called userfile, and the form must be of type “multipart”.

<form method="post" action="some_action" enctype="multipart/form-data" />

If you would like to set your own field name simply pass its value to the do_upload() method:

$field_name = "some_field_name";
$this->upload->do_upload($field_name);
doc_CodeIgniter
2016-10-15 16:32:01
Comments
Leave a Comment

Please login to continue.