Problem with dowloading pdf and maybe office files with Internet Explorer and SSL (https)

goudal - March 27, 2008 - 08:57
Project:Filemanager
Version:5.x-1.x-dev
Component:Code
Category:bug report
Priority:critical
Assigned:Unassigned
Status:active
Description

Due to a « feature » in Internet Explorer, the Cache-Control header value must be set to private. When using the default Drupal one, it causes strange messages (like : unable to find the address of the host).

I have corrected the following code (by stealing some code to the cck filefield module) :

function filemanager_transfer($file, $working, $headers = FALSE) {
  $file = filemanager_get_file_info($file);
  $filepath = filemanager_create_path($file, $working);

  $name = mime_header_encode($file->filename);
  $type = mime_header_encode($file->filemime);

  $default_headers = array(
    'Content-Length: '. $file->size,
    'Content-Type: '. $type.'; name='.$name,
    'Content-Disposition: attachment; filename='. $name,
    'Cache-Control: private'
  );

I can provide a patch is someone gives me the correct instruction to produce it.

 
 

Drupal is a registered trademark of Dries Buytaert.