cakephp,如何上传图片
在我看来,我有以下形式:cakephp,如何上传图片,php,image,cakephp,upload,Php,Image,Cakephp,Upload,在我看来,我有以下形式: <form enctype="multipart/form-data" action="<?php echo $this->base; ?>/reviews/upload/" method="post" target="_blank"> <input type="file" id="file" name="file" /> <input type="submit" /> </form> 但它总是空的
<form enctype="multipart/form-data" action="<?php echo $this->base; ?>/reviews/upload/" method="post" target="_blank">
<input type="file" id="file" name="file" />
<input type="submit" />
</form>
但它总是空的!我已经试过“这个->请求”,“这个->数据”,但它总是空的。
我做错了什么?尝试将输入的名称更改为其他名称,然后更改为文件。以前有过这样的问题 尝试将输入的名称更改为其他名称,然后更改为文件。以前有过这样的问题 试着用蛋糕的方式做
echo $this->Form->create("Review", array("action" => "upload", "type" => "file"));
echo $this->Form->input("my-file", array("type" => "file"));
echo $this->Form->end();
在你的评论中
public function upload() {
debug($this->request->data);
}
使用debug over var_dump和print_r作为优势,通过在core中将调试级别设置为0,可以在生产模式应用程序范围内关闭调试。php
echo $this->Form->create("Review", array("action" => "upload", "type" => "file"));
echo $this->Form->input("my-file", array("type" => "file"));
echo $this->Form->end();
在你的评论中
public function upload() {
debug($this->request->data);
}
使用debug over var_dump和print_r作为优势,通过在core.php中将调试级别设置为0,可以在生产模式应用程序范围内关闭调试。有人知道我如何读取控制器中的POST数据吗?仍然没有。有人知道如何读取控制器中的POST数据吗?