FuelPHP â ãã¡ã¤ã«ã¢ãããã¼ãå¦çãå®è£ ãã
è¨å®ãã¡ã¤ã«ãé ç½®
/fuel/core/config/upload.phpã/fuel/app/config/ã«ã³ãã¼ãã
âã¢ãããã¼ãã§å ±éã®è¨å®äºé ãããã°ããã§è¨å®ãã¦ãã
â»è¨å®ã§ããå 容ã¯æ¬å®¶ã®ããã¥ã¢ã«ãåç §(1.7)
Â
ã¢ãããã¼ãã¨ã©ã¼ã®æ¥æ¬èªãã¡ã¤ã«ãé ç½®
/fuel/core/lang/en/upload.phpã/fuel/app/lang/jaã«ã³ãã¼ãã
âæ¥æ¬èªã«ãªãã
â»FuelPHP â ãè¨å®ãè¨èªè¨å®ãããããã£ã¦ãã
Â
php.iniãä¿®æ£
extension=php_fileinfo.dllãæå¹å
 ãã®ä»php.iniã®è¨å®ã¯ãã¡ãã®ãµã¤ãã¨ããåç § â PHPã¾ã¨ã ã¢ãããã¼ã
Â
Controllerãä½æ
// è¨å®(è¨å®ãã¡ã¤ã«ã§è¨å®ããªãã£ãåå¥ã®è¨å®ãã»ãã)
$config = array(
   'path' => 'files',
);
// ã¢ãããã¼ãå®è¡
Upload::process($config);
// ã¨ã©ã¼ãæ¤è¨¼
if (Upload::is_valid())
{
   // ã¢ãããã¼ããã¡ã¤ã«ãä¿å
   Upload::save();
}
// ã¨ã©ã¼ã®å ´åã¯ãä¸è¨ã«ã¨ã©ã¼æ å ±ãå ¥ã£ã¦ãã
// Upload::get_errors()
// æ£å¸¸å¦çã®å ´åã¯ãä¸è¨ã«ãã¡ã¤ã«æ å ±ãå ¥ã£ã¦ãã
// Upload::get_files()
Â
viewãä½æ
<?php echo Form::open(array('name'=>'upload','enctype'=>'multipart/form-data','method'=>'post')); ?>
<?php echo Form::hidden('MAX_FILE_SIZE', '1500', array('id' => 'file_size')); ?>
<?php echo Form::file('upload',array('class'=>'col-md-4')); ?>
<?php echo Form::submit('submit', 'ä¿å', array('class' => 'btn btn-primary')); ?>
<?php echo Form::close(); ?>
Â