我想向我的Zend AMF發送請求以打開文件下載的對話框。如何從Zend AMF + AS3打開文件對話框
的過程:
發送到從我的Flash應用程序,處理結果MYSQL用PHP Zend服務器的請求,然後將結果發送到瀏覽器的文件下載(.CSV)和一個結果真或虛假的應用程序
我有代碼工作在Zend環境以外,但當然,當我去echo /打印文件 - 它發回閃光沒有任何事情發生。
有沒有辦法解決這個問題?
$file = "";
$outtype = "Content-type: application/octet-stream";
header($outtype);
$outtype = 'Content-disposition: attachment; filename="file.csv"';
header($outtype);
$stmt->bind_result($id, $username, $email, $location);
while($stmt -> fetch()){
$file .= '"'.addslashes($col1).'"';
$file .= ',"'.addslashes($col2).'"';
$file .= ',"'.addslashes($col3).'"';
$file .= "\n";
}
print $file;
exit;
或者,我是否只需要在zend請求之外請求...?
到目前爲止,我已經改變了頭,使使用Zend頭:
$this->setHeader('Content-Type', 'application/octet-stream');
$this->setHeader('Content-disposition:', 'attachment');
$this->setHeader('filename:', 'file.csv');
但我不確定如何在$文件附加到「FILE.CSV」,然後返回真到Flash結果並下載文件..(zend noob在這裏我很害怕..)
我將不得不採取一個仔細看了看那個。如果我誠實 - 這對我的技能有點深遠,但感謝把我放在正確的方向! – Beans 2010-12-05 22:29:30