My contemplations and diurnal novelties are publicized here


You might be facing this issue in IE “Adobe Acrobat could not open because it is either not a supported file type or because the file has been damaged” off course that’s why you are here.

There exist a plenty of headers that can be included to make your forceful download workable in IE, I have gone through several and mentioned those in reference below.

But the solution that worked from me is extremely simple. (PHP code)

$filename = $this->paramfile;

header(“Content-Type: application/octet-stream”, FALSE);

header(“Content-Disposition: attachment; filename=”.basename($filename));

readfile($filename);

exit;

References:-

  1. http://stackoverflow.com/questions/1218925/php-script-to-download-file-not-working-in-ie
  2. http://stackoverflow.com/questions/49284/file-downloads-in-ie6
  3. http://forums.asp.net/t/1036628.aspx/2/10
  4. http://itworkerdaily.wordpress.com/2007/06/26/php-developper-adobe-pdf-error-message-indicating-adobe-reader-could-not-open-the-file-%E2%80%98xxxfdf%E2%80%99-because-it-is-either-not-a-supported-file-type-or-because-the-file-has-been-corrupt/#more-64
  5. http://itworkerdaily.wordpress.com/category/internet-explorer/
  6. http://www.codingforums.com/archive/index.php/t-70819.html
  7. http://www.codingforums.com/showthread.php?t=70819
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: