Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Content-disposition


mzeidler

Recommended Posts

Posted

Currently, I am experiencing a problem with properly viewing PDF files within IE6. One of the path's taken to resolve this matter involves "Content-disposition" I have http header info from URL-A which displays only jibberish and does "NOT" display PDF properly. The Header "Content-disposition:" from URL-A reads as follows "inline; filename=doc.pdf" Note, this does NOT display proper PDF file within my IE6, only jibberish/text. However URL-B DOES display proper PDF file within my IE6, So I know my IE6 CAN display PDF files. the header info for URL-B Content-disposition is as follows, "inline; filename=Shop Line_item183.pdf" There is an obvious difference between the two "Content-disposition" URL-A vs. URL-B. So my question is.... Does anyone here have an idea why I am getting different "Content-disposition" between the two??? and where a fix can be made to resolve this problem?? What file? what lines of code?? Simply I am trying to fix the problem and allow customers to view a proper PDF file from within IE6, like the below URL-B.......

http://www.chilipepper.it/catalog/pdf_data...products_id=100

 

Not like URL-A as i'm getting now....nothing but jibberish as seen from IE6 below....

http://www.internationalltg.com/pdf_datash...products_id=398

 

Please, anyone have a clue here?? Much appreciated,

z

Posted

Have you checked the Cache-Control Header?

 

Try setting it like this:

header("Cache-Control: private",false);

Posted

This would be added to the fpdf.php file, correct? currently it has.....

header("Cache-Control: must-revalidate, post-check=0, pre-check=0");

Are you suggesting commenting this out, and replacing it with the cache info below??

 

 

 

Have you checked the Cache-Control Header?

 

Try setting it like this:

header("Cache-Control: private",false);

Posted
This would be added to the fpdf.php file, correct? currently it has.....

header("Cache-Control: must-revalidate, post-check=0, pre-check=0");

Are you suggesting commenting this out, and replacing it with the cache info below??

yes have you tried it?

Posted

Is this added twice to the header info around line 1000?

header("Cache-Control: private",false);???

 

 

Currently reads as follows....

//Send to browser

Header('Content-Type: application/pdf');

if(headers_sent())

$this->Error('Some data has already been output to browser, can\'t send PDF file');

Header('Content-Length: '.strlen($this->buffer));

Header('Content-disposition: inline; filename=doc.pdf');

//header("Pragma: public");

header( 'Pragma:' );

//header("Cache-Control: must-revalidate, post-check=0, pre-check=0");

header("Content-Transfer-Encoding: binary");

 

 

And......

 

 

}

else

{

if($download)

{

//Download file

if(isset($HTTP_ENV_VARS['HTTP_USER_AGENT']) and strpos($HTTP_ENV_VARS['HTTP_USER_AGENT'],'MSIE 5.5'))

Header('Content-Type: application/dummy');

else

Header('Content-Type: application/octet-stream');

if(headers_sent())

$this->Error('Some data has already been output to browser, can\'t send PDF file');

Header('Content-Length: '.strlen($this->buffer));

Header('Content-disposition: attachment; filename='.$file);

//header("Pragma: public");

header( 'Pragma:' );

//header("Cache-Control: must-revalidate, post-check=0, pre-check=0");

header("Content-Transfer-Encoding: binary");

 

echo $this->buffer;

exit();

 

Does anything here need commented out before adding the line of code suggested?? is it added twice??

 

yes have you tried it?
Posted

Not sure which version you're using. I see from the code you posted that it checks if the pdf already exists and if so it does not try to send it again. But that 2nd case does not include the cache tag. Is that the case that fails?

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...