我正在使用exec命令创建pdf的缩略图。
在添加代码时工作正常:
但是出现以下错误消息。
警告
警告:无法移动文件! 错误
移动文件时出错
编辑时:
收到错误消息,并显示以下错误消息:
警告
警告:无法移动文件! 错误
移动文件时出错
代码:
$uploadPath = JPATH_ADMINISTRATOR
. '/components/com_ets_fast_track/assets/buildings/'
. $filename;
$fileTemp = $file['tmp_name'];
if(!JFile::exists($uploadPath)){
if (!JFile::upload($fileTemp, $uploadPath)){
JError::raiseWarning(500, 'Error moving file');
return false;
} else {
//name the thumbnail image the same as the pdf file
$pdfWithPath = $uploadPath;
$thumbDirectory = JPATH_ADMINISTRATOR
. '/components/com_ets_fast_track/assets/buildings/';
$thumb = basename($filename, ".pdf");
//add the desired extension to the thumbnail
$thumb = $thumb.".jpg";
$cmd="convert \"{$uploadPath}[0]\" -geometry 227x295 -density 222x294 -quality 100 -channel RGBA -bordercolor white -border 1x1 -fill none -draw matte 0,0 floodfill $thumbDirectory$thumb";
exec($cmd);
}
}