在“中上载图像”;webroot/img“;蛋糕php中的文件夹
“我想在cake php的webroot/img文件夹中上传图像,但我无法上传 建议我一些解决方案,因为我对cake php还不熟悉 但什么都不管用,帮帮我吧“ admin_add.ctp代码为在“中上载图像”;webroot/img“;蛋糕php中的文件夹,php,cakephp,Php,Cakephp,“我想在cake php的webroot/img文件夹中上传图像,但我无法上传 建议我一些解决方案,因为我对cake php还不熟悉 但什么都不管用,帮帮我吧“ admin_add.ctp代码为 <div class="homes form"> <?php echo $this->Form->create('Home', array('type' => 'file')); ?> <fieldset> <legend>&l
<div class="homes form">
<?php echo $this->Form->create('Home', array('type' => 'file')); ?>
<fieldset>
<legend><?php echo __('Add Home content'); ?></legend>
<?php
echo $this->Form->input('title');
echo $this->Form->input('body');
echo $this->Form->input('image');
?>
</fieldset>
<?php echo $this->Form->end(__('Submit'));
?>
</div>
请参阅:
需要检查以下事项:
您还可以使用$\u SERVER['DOCUMENT\u ROOT']更改上述函数中的路径。会出现什么错误?
<div class="homes form">
<?php echo $this->Form->create('Home', array('type' => 'file')); ?>
<fieldset>
<legend><?php echo __('Add Home content'); ?></legend>
<?php
echo $this->Form->input('title');
echo $this->Form->input('body');
echo $this->Form->input('image');
?>
</fieldset>
<?php echo $this->Form->end(__('Submit'));
?>
</div>
Output:
`Array
(
[Home] => Array
(
[title] => vhbk
[body] => ,bjljbl.
[image] => Array
(
[name] => DSC03371.JPG
[type] =>
[tmp_name] =>
[error] => 1
[size] => 0
)
)
)`