1
(Uploadify 2.1.4 사용) Symfony2에서 AJAX 요청을 통해받은 텍스트 파일을 업로드하고 싶습니다. 액션에서 어떻게 처리 할 수 있습니까? official docs에 대한 정보를 찾았지만 찾고있는 정보가 아닌 것 같습니다.Symfony2 : 파일 업로드 플러그인을 사용하여 파일 업로드
$adapter = new Zend_File_Transfer_Adapter_Http();
$adapter->setFilters(array(
'Rename' => array(
'target' => sprintf('%s/%d_%s', Zend_Registry::get('config')->uploads->uploadPath, time(), $adapter->getFileName(null, false), 'UTF-8'),
'overwrite' => true,
),
));
try
{
$adapter->receive();
}
catch (Zend_File_Transfer_Exception $e)
{
throw new Zend_Controller_Action_Exception(sprintf('Bad file: %s', $e->getMessage()));
}
불행히도 솔루션의 유효성 검사가 부족합니다. 아마 나 한테 뭔가 줄 수있을거야. 감사! –
누군가 관련 부품으로 이것을 단순화 해 줄 수 있습니까? 감사! –