excel and explorer

A

Anonymous

Guest
HI,
I'm using a class to write from a db an excel file to download.

I' ve this problem: I cannot open directly the file from explorer if I start the session in my php file.(the 'save' mode is ok.)

If I start the session 'session_start();' when i try to download the file from explorer
it displays more or less this message : cannot find 'filePath'. Check file name and position.
firefox downloads the file correctly instead.

without starting the session evrerythings works fine.

this is the header
header ( "Expires: Mon, 1 Apr 1974 05:00:00 GMT");
header ( "Last-Modified: " . gmdate("D,d M YH:i:s") . " GMT" );
header ( "Pragma: no-cache" );
header ( "Content-type: application/vnd.ms-excel; name=".$name.".xls" );
header ( "Content-Disposition: attachment; filename=".$name.".xls");
// CONTENT

thanks. sorry for my poor english.
 
hmmz... there is most probably a conflict with session_start header and header command..
mozilla seems to accept different positioning while IE doesnt... strange but a fact..

Are you starting the session first and then sending headers?
 
thanks for your help,
yes I start the session before header();
i tried to start it after the header function following gesf, but it still won't work.
i'll keep on trying.
 
try removing other headers.. leave only those that you need to test the function to work with sessions..
and why are you starting sessions anyways?
i never saw you using $_SESSION superglobal in your code..
 
:D

I found a post in http://it.php.net/session_start

quoting:
Kevin
27-Oct-2004 07:31
If you're having a problem with a file download script not working with IE if you call session_start() before sending the file, then try adding a session_cache_limiter() call before session_start().
I use session_cache_limiter('none'), but 'public' and 'private' seem to fix the problem too; use whichever suits your application.

I've just done a quick test and it seems to work. bella kevin!
 
Back
Top