$request = $this->getRequest();
if($request->isPost()) {
$files = $request->getFiles()->toArray();
$httpadapter = new Http();
//限制大小和类型
$filesize = new Size(array('max' => 100000 )); //100KB
$extension = new Extension(array('extension' => array('doc')));
$httpadapter->setValidators(array($filesize, $extension), $files['resume']['name']);
if($httpadapter->isValid()) {
$httpadapter->setDestination('./data/upload/');
if($httpadapter->receive($files['resume']['name'])) {
$newfile = $httpadapter->getFileName();
}
}
}