public function action_index()
{
$path = APPPATH.'config/test.php';
$filesize = File::read($path);
Debug::dump($filesize);
$this->response->body = View::factory('welcome/index');
}
3) Create file APPPATH/config/test.php with the following contents:
<?php return array ( 'test_key1' => 'test data 1', 'test_key2' => 'test data 2', 'test_key3' => 'test data 3', ); /* End of file temp.php */
Paul Boco wrote on Sunday 29th of May 2011:Thanks for clearing that up.
Guess I'll do it the old fashioned way$filesize = filesize($filename);
public function action_index()
{
$area = \File::instance('my_area');
$this->response->body = View::factory('welcome/index');
}
Then, I added file.php to app/config with the following contents:
<?php return array( // inside app/config/file.php 'areas' => array( 'my_area' => array( 'basedir' => DOCROOT.'uploads', 'use_locks' => true, ), ), ); /* End of file file.php */Lastly, I created directory public/uploads.
Notice!
ErrorException [ Notice ]: Object of class Fuel\Core\File_Area could not be converted to int
COREPATH/classes/file.php @ line 49:
48:{
49: static::$areas[$name] = \File_Area::factory($config) + static::$base_area;
50: }
It looks like you're new here. If you want to get involved, click one of these buttons!