NYCPHP Meetup

NYPHP.org

[nycphp-talk] need help!

Phillip Powell phillip.powell at adnet-sys.com
Tue Jun 8 09:42:36 EDT 2004


You have to change your headers to force them to download for IE as well 
as for other browsers.  You will need to do more with header() to do so:

    function &generateForceDownloadHeaders($fullFilePath = '') {        
    // STATIC VOID METHOD
        $file = ($this->fullFilePath) ? $this->fullFilePath : $fullFilePath;
        if (is_file($file)) {
         $filesize = @filesize($file);
         header('Content-Disposition: attachment; filename="' . 
substr($file, strrpos($file, '/') + 1, strlen($file)) . '"');
         header("Content-Length: $filesize");
         header('Content-Type: application/octet-stream');
         header('Content-Transfer-Encoding: binary');
         header('Pragma: no-cache');
         header('Expires: 0');
         @readfile($file);
         @set_time_limit(600);
        }
    }

Phil

haha wrote:

>Hi All:
>
>Realy no body know about this problem?
>It works for netscape, but it doesn't work for IE.
>
>Thanks again.
>
>Bill
>
>--- haha <heli_travel at yahoo.com> wrote:
>  
>
>>Hi All:
>>
>>I try to program the download program.
>>I got an very interesting issue:
>>Here is the code:
>>
>>header("Content-Type: application/vnd.ms-excel;
>>charset=$dest_charset");
>>print($report_content); 
>>
>>But when I download and save ,the save window showed, I click
>>on
>>"Save",  I got this waired message:
>>
>>"
>>Internet Exploer was not able to open this Internet site. The
>>requested site is either unavailable or cannot be found.
>>Please
>>try again later.
>>"
>>but if I remove the header:
>>"header("Content-Type: application/vnd.ms-excel;
>>charset=$dest_charset");"
>>
>>It print out all the contents.
>>
>>Please help!
>>
>>Thanks,
>>
>>Bill
>>
>>
>>
>>
>>	
>>		
>>__________________________________
>>Do you Yahoo!?
>>Friends.  Fun.  Try the all-new Yahoo! Messenger.
>>http://messenger.yahoo.com/ 
>>_______________________________________________
>>talk mailing list
>>talk at lists.nyphp.org
>>http://lists.nyphp.org/mailman/listinfo/talk
>>    
>>
>
>
>
>	
>		
>__________________________________
>Do you Yahoo!?
>Friends.  Fun.  Try the all-new Yahoo! Messenger.
>http://messenger.yahoo.com/ 
>_______________________________________________
>talk mailing list
>talk at lists.nyphp.org
>http://lists.nyphp.org/mailman/listinfo/talk
>
>  
>


-- 
---------------------------------------------------------------------------------
Phil Powell
Multimedia Programmer
BPX Technologies, Inc.
#: (703) 709-7218 x107 
Fax: (703) 709-7219

	




More information about the talk mailing list