Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function action_submit()
- {
- if (Input::method() == 'POST') {
- // custom config for this upload
- $config = array(
- 'path' => APPPATH.'tmp',
- 'randomize' => true,
- 'ext_whitelist' => array('jpg', 'jpeg', 'gif', 'png'),
- );
- // process the uploaded files in $_FILES
- Upload::process($config);
- // if valid files
- if (Upload::is_valid()) {
- // save them according to the config
- Upload::save();
- // let's check if we have something normally
- // here u wud call a model method to update
- // the db
- Debug::dump(Upload::get_files());
- } else {
- // process errors
- foreach (Upload::get_errors() as $file) {
- // file is an array with file info
- echo $file['message'];
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement