English 中文(简体)
在派头人下载PDF时,Safari 附录.html
原标题:When sending headers to download a PDF, Safari appends .html

这里是请求和回复方

http://www.example.com/get/pdf

GET /~get/pdf HTTP/1.1
Host: www.example.com
User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; en-US; rv:1.9.2.3) Gecko/20100401 Firefox/3.6.3
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: en-us,en;q=0.5
Accept-Encoding: gzip,deflate
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
Keep-Alive: 115
Connection: keep-alive
Referer: http://www.example.com
Cookie: etc 

HTTP/1.1 200 OK
Date: Thu, 29 Apr 2010 02:20:43 GMT
Server: Apache/2.2.14 (Unix) mod_ssl/2.2.14 OpenSSL/0.9.8i DAV/2 mod_auth_passthrough/2.1 mod_bwlimited/1.4 FrontPage/5.0.2.2635
X-Powered-By: Me
Expires: Thu, 19 Nov 1981 08:52:00 GMT
Pragma: no-cache
Cache-Control: private
Content-Disposition: attachment; filename="File #1.pdf"
Content-Length: 18776
Keep-Alive: timeout=5, max=100
Connection: Keep-Alive
Content-Type: text/html; charset=utf-8
----------------------------------------------------------

基本上,答复负责人是由DOMPDF 发送的stream()。

http://code>File #1.pdf。 然而,在Sissa,该档案作为保存。

有人知道为什么Safari在文件名后添加HTML扩展名吗?

I m还使用Kohana 3,用控制器方法为国防军服务。

最佳回答

从内容类型看不正确,即如果确定内容,你的问题将得到解决。

问题回答

我通过增加死亡(死亡)来确定,然后将死亡(死亡)移入。

$dompdf = new DOMPDF();
$dompdf->set_paper("a4", "portrait"); 
$dompdf->load_html($html);
$dompdf->render();
$dompdf->stream($invoice.".pdf");
die();

因为你告诉它它是超文本的。 页: 1

Content-Type: text/html; charset=utf-8

你们可以改变Kohaana 3号这样的头盔。

$this->request->headers[ Content-Type ] = File::mime($file);




相关问题
Brute-force/DoS prevention in PHP [closed]

I am trying to write a script to prevent brute-force login attempts in a website I m building. The logic goes something like this: User sends login information. Check if username and password is ...

please can anyone check this while loop and if condition

<?php $con=mysql_connect("localhost","mts","mts"); if(!con) { die( unable to connect . mysql_error()); } mysql_select_db("mts",$con); /* date_default_timezone_set ("Asia/Calcutta"); $date = ...

定值美元

如何确认来自正确来源的数字。

Generating a drop down list of timezones with PHP

Most sites need some way to show the dates on the site in the users preferred timezone. Below are two lists that I found and then one method using the built in PHP DateTime class in PHP 5. I need ...

Text as watermarking in PHP

I want to create text as a watermark for an image. the water mark should have the following properties front: Impact color: white opacity: 31% Font style: regular, bold Bevel and Emboss size: 30 ...

How does php cast boolean variables?

How does php cast boolean variables? I was trying to save a boolean value to an array: $result["Users"]["is_login"] = true; but when I use debug the is_login value is blank. and when I do ...

热门标签