1
yii에 제공된 확장을 사용하고 싶습니다.yii의 파일 압축/압축 해제
업로드 된 파일을 압축/압축 해제하려면 yii에서 일부 확장 프로그램을 제안하십시오. 서버 또는 디렉토리에 저장하고 다운로드하는 동안 다시 압축을 풉니 다.
여기 파일을 업로드하는 데 확장 프로그램 EAjaxUpload 확장을 사용했습니다. CONTROLLER
action{
Yii::import("ext.EAjaxUpload.qqFileUploader");
$folder = 'Resumes/';
$allowedExtensions = array("doc","docx");
$sizeLimit = 10 * 1024 *1024;
$uploader = new qqFileUploader($allowedExtensions, $sizeLimit);
$result = $uploader->handleUpload($folder);
if(isset($result['success']))
if($result['success']==true)
{
$fileSize=filesize($folder.$result['filename']);
$fileName=$result['filename'];
$mimetype = $fileName['mime'];
}
// rename($folder.$result['filename'],$folder.$fileName);
$return = htmlspecialchars(json_encode($result), ENT_NOQUOTES);
echo $return;
}
에서보기
<?php
$this->widget('ext.EAjaxUpload.EAjaxUpload',
array(
'id'=>'uploadResume',
'config'=>array(
'action'=>Yii::app()->baseUrl.'/index.php?r=site/word',
'allowedExtensions'=>array("doc","docx"),
'sizeLimit'=>10*1024*1024,
'minSizeLimit'=>1*1024,
'multiple'=>false,
'onComplete'=>'js:function(id, fileName, responseJSON){alert(messages);}),
?>
IN
.
와 명령 부를 수있는, 압축을 풉니 다? –
안녕 .. 그 dint 도움이 .. 그 전체 응용 프로그램 출력을 압축 ..하지만 내가 업로드 한 파일을 압축하고 저장하고 싶습니다 .. 그리고 압축을 풀 때 .. 당신은 어떻게 할 knw 어떻게합니까 ?? – DpGp
죄송합니다. –