Hi, all!
Sorry about rudimentary question.
[environment]
- phalcon3.0.3
- xampp v3.2.2
[[ PHP INFO ]]
- PHP Version 7.0.13
- sys_temp_dir : no value
- upload_max_filesize : 2M
- upload_tmp_dir : C:\xampp\tmp
- user_dir : no value
[[QUESTION]]---------------------------
I am trying about image-file upload. But, $this->request->hasFiles(); This value return false;
MY purpose is make thumbnails. Which directory does phalcon refer to?
Source codes
[[HTML]]
<form action="/invo/products/confirm" method="post" enctype="multipart/form-data">
<input type="file" name="up_image" />
<input type=submit>
</form>
[[Controller]]
<?php
use Phalcon\Mvc\Controller;
use Phalcon\Mvc\Model\Criteria;
use Phalcon\Paginator\Adapter\Model as Paginator;
/**
* ProductsController
*
* Manage CRUD operations for products
*/
class ProductsController extends ControllerBase
{
public function initialize()
{
$this->tag->setTitle('Manage your products');
parent::initialize();
}
public function confirmAction()
{
// Check if the user has uploaded files
if ($this->request->hasFiles() == true) {
// Print the real file names and their sizes
foreach ($this->request->getUploadedFiles() as $file) {
echo $file->getName(), " ", $file->getSize(), "\n";
}
}else{
echo "No upload file"; //<========== CAME HERE!!
}
}
[[SecurityPlugin.php]]
//Public area resources
$publicResources = array(
'products' => array('index', 'search', 'new', 'edit', 'save', 'confirm', 'create', 'delete'),
I confirmed this folder(C:\xampp\tmp). There are upload files in this folder!! But $this->request->hasFiles() is not move. Other posted input-values was received.
Please help!!