Love Fuel?    Donate

FuelPHP Forums

Ask your question about FuelPHP in the appropriate forum, or help others by answering their questions.
file upload
  • hi, problem with file upload, file not save !!
                //var_dump($_FILES);
                $config = array(
                    'path'          => DOCROOT . 'files',
                    'randomize'     => true,
                    'ext_whitelist' => array('img', 'jpg', 'jpeg', 'gif', 'png'),
                );
                \Upload::process($config);
                if (\Upload::is_valid())
                {
                    \Upload::save();
                    var_dump(\Upload::get_files());
                }
                foreach (\Upload::get_errors() as $file)
                {
                    var_dump($file['errors']);
                }

    return :
    array(1) {
    [0]=>
    array(12) {
    ["field"]=>
    string(3) "pic"
    ["saved_as"]=>
    NULL
    ["name"]=>
    string(14) "1403788852.jpg"
    ["type"]=>
    string(10) "image/jpeg"
    ["file"]=>
    string(29) "D:\Server\PHP\tmp\phpA5DB.tmp"
    ["error"]=>
    bool(false)
    ["size"]=>
    int(4311)
    ["extension"]=>
    string(3) "jpg"
    ["basename"]=>
    string(10) "1403788852"
    ["mimetype"]=>
    string(10) "image/jpeg"
    ["saved_to"]=>
    string(37) "D:\Server\WWW\fuel\public\files\"
    ["errors"]=>
    array(0) {
    }
    }
    }



    saved_as is NULL and picture not save.
    save path exist and check file upload by var_dump($_FILES) and save file with <span style="color: #000000"><span style="color: #0000BB">move_uploaded_file</span><span style="color: #007700"></span></span>
  • HarroHarro
    Accepted Answer
    There was a bug in the Upload package v2.0.3. Edit your composer.json file, change the version to 2.0.4, and run "composer update" to get the new version.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

In this Discussion