瀏覽代碼

Assign a meaningful name (and mime type) to the files produced by the (non-interactive) web export.

git-svn-id: http://svn.code.sf.net/p/itop/code/trunk@3722 a333f486-631f-4898-b8df-5754b55c2be0
dflaven 10 年之前
父節點
當前提交
3775b8fa6f
共有 1 個文件被更改,包括 2 次插入1 次删除
  1. 2 1
      webservices/export-v2.php

+ 2 - 1
webservices/export-v2.php

@@ -487,7 +487,7 @@ function CheckParameters($sExpression, $sQueryId, $sFormat)
 	return $oExporter;
 }
 
-function DoExport(Page $oP, BulkExport $oExporter, $bInteractive = false)
+function DoExport(WebPage $oP, BulkExport $oExporter, $bInteractive = false)
 {
 	$oExporter->SetHttpHeaders($oP);
 	$exportResult = $oExporter->GetHeader();
@@ -507,6 +507,7 @@ function DoExport(Page $oP, BulkExport $oExporter, $bInteractive = false)
 	{
 		$exportResult .= $oExporter->GetFooter();
 		$oP->SetContentType($oExporter->GetMimeType());
+		$oP->SetContentDisposition('attachment', $oExporter->GetDownloadFileName());
 		$oP->add($exportResult);
 		$oExporter->Cleanup();
 	}