次の方法を使用して、画像マジックを使用してPDFファイルをアップロードおよび変換しています。作成方法は機能していますが、画像はそれぞれのディレクトリにアップロードされていません。
public function actionCreate()
{
$model=new Alerts;
// Uncomment the following line if AJAX validation is needed
// $this->performAjaxValidation($model);
if(isset($_POST['Alerts']))
{
$model->attributes=$_POST['Alerts'];
$model->infoFile=CUploadedFile::getInstance($model,'infoFile');
$pdf_file = $model->infoFile->name;
$save_to = $model->getUploadPath()."sample.jpg";
if($model->save()){
exec('convert "'.$pdf_file.'" -colorspace RGB -resize 800 "'.$save_to.'"', $output, $return_var);
}
$this->redirect(array('view','id'=>$model->id));
}
$this->render('create',array(
'model'=>$model,
));
}
何が問題なのか教えてください。
Web サーバーに書き込み権限が$model->getUploadPath()
ありYii::getPathofAlias('webroot').'/uploads/';
、Image Magic が Web サーバーに適切にインストールおよび構成されていることを確認できます。