qdpm(项目经理)无法呈现附加图像预览

qdpm (project manager) fails rendering attached image previews

问题如下,如果您购买了 qdpm "extended" 插件(qdpm 的付费版本),您会注意到可以下载附件图像,但无法在 [=19] 上预览=] 按钮。

渲染图像显示“图像无法显示,因为包含错误”。

非常烦人,我无法联系到该软件的技术支持,但它在 PHP (Symphony) 上是开源的,我可以修改代码。

我回答了我自己的问题,因为我实现了解决错误。

您需要修改此文件:

qdpm_root/core/apps/qdPMExtended/modules/attachments/actions/actions.class.php

搜索 executeView() 函数并替换此代码:

if($size = getimagesize($file_path))
{
  $filename = substr(str_replace(array(' ',','),'_',$attachments->getFile()),7);

  header('Content-Disposition: filename="' . $filename . '"');                          
  header("Content-type: {$size['mime']}");                  
  ob_clean();
  flush();

  readfile($file_path);
}

有了这个:

if($size = getimagesize($file_path))
{
  $filename = substr(str_replace(array(' ',','),'_',$attachments->getFile()),7);

  header('Content-Disposition: filename="' . $filename . '"');                          
  header("Content-type: {$size['mime']}");     

  readfile($file_path);             
  ob_clean();
  flush();
}

它就像一个魅力。