Why is there no redirection?

Source: Internet
Author: User
Why is the pk. php file content not redirected?







Ooo.pdf download



Pku. php file content
Header ("Content-type: application/pdf ");
Header ('content-Disposition: attachment?filename=cute ');
Readfile ("oooworkflow ");
?>
In this example, ooo.htm is the source file, and cute.pdf is the name of the downloaded file.

However, it is strange that the PDF file is downloaded directly when the tag is used in pk. php, and the url is not changed to pku. php.
At least jump to pku. php and then download it ..


Reply to discussion (solution)

Filenameis cute.htm.
The content is ooo.pdf

When you see pku. php in the browser, PHP has generated an html file and sent it to the browser for display.

The current process is that php directly points to this PDF file and passes it to the browser. the browser naturally downloads the file directly.

That's what I understand.

At least change the url address bar to pku. php.

At least change the url address bar to pku. php.

As I said in 2 #, in my opinion, if the address bar can see pku. php: The browser has understood phu. html text generated by php. actually, no, phu. php points to a PDF file that cannot be understood by the browser, so you can download it directly, so you cannot see the php file in the address bar.

This is what I understand and do not know whether it is accurate.

It's the reason for the browser. generally, a blank page should appear.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.