Search
 
SCRIPT & CODE EXAMPLE
 

PHP

view a pdf file in the browser using the php header function

$file = 'headerPdfFile.pdf';

$filename = 'IamPdfFile.pdf';
  
// Header content type
header('Content-type: application/pdf');
  
header('Content-Disposition: inline; filename="' . $filename . '"');  
  
// Read the file
@readfile($file);
Comment

php header pdf

<?php
header("Pragma: public");
    header("Expires: 0");
    header("Accept-Ranges: bytes");
    header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
    header("Content-Type: application/pdf");
    header("Content-Disposition: attachment; filename=order.pdf");
    header("Content-Transfer-Encoding: binary");
Comment

PREVIOUS NEXT
Code Example
Php :: php echo number with decimal 
Php :: php get class name without namespace from string 
Php :: make select element readonly 
Php :: how to mask phone number in php 
Php :: php explode multiple delimiters 
Php :: php top frameworks 
Php :: laravel validation unique if this field is changed 
Php :: wordpress thumbnail 
Php :: json stringify php decode 
Php :: php heredoc 
Php :: mysqli loop 
Php :: remove whitespace from string php 
Php :: laravel create search 
Php :: if condition inside echo in php 
Php :: searching inside a file using php 
Php :: laravel clear page cache 
Php :: php convert month number to name 
Php :: increase memory limit wordpress 
Php :: remove notices php 
Php :: self submit form php 
Php :: foreach stdclass object php 
Php :: merge two query results in laravel 
Php :: twig is in string 
Php :: redirection in php 
Php :: install php-8 
Php :: getMessage in php 
Php :: cloudflare country 
Php :: laravel run migration specific file 
Php :: take file data in variable php 
Php :: word press get home page id 
ADD CONTENT
Topic
Content
Source link
Name
9+9 =