fpassthru sessions and avant browser issues

This is a discussion on fpassthru sessions and avant browser issues within the PHP Language forums, part of the PHP Programming Forums category; I have a section of my website where customers can login and download a few select files. The download links ...


Go Back   Usenet Forums > PHP Programming Forums > PHP Language

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 11-12-2003
GameDev
 
Posts: n/a
Default fpassthru sessions and avant browser issues

I have a section of my website where customers can login and download a few
select files.
The download links are to php scripts that decide which files to download.

Generally it works fine. However I have one browser compaibilty problem and
an annoyance with MS Internet Explorer

With IE if the user cancels the download (they are only small downloads so
this is unlikely) the browser will stop working corectly from then on: All
links on the page will stop working until the browser is closed and
reopened.

With the Avant Browser (http://www.avantbrowser.com ) Downloads fail as the
DL script seems to bump the user to the customer login page.

Here's the code:


<?php
//Generic PHP Header Commands
session_start();

//Check the Customer is Logged In and kick them if they aren't (I think this
is where avant browser fails)
if( !$_SESSION['CustomerID'] )
{
header("Location: http://{$_SERVER['HTTP_HOST']}" .
dirname($_SERVER['PHP_SELF']) . '/cust-login.php');
exit();
}

//then I get some data about the filename from our database and assign the
correct filename to $filepath
//I've deleted this section because it is irrelevant to this problem

//here's where I output the file
$fp = fopen($filepath, "rb");
// send the right headers
header('Cache-Control: no-cache, must-revalidate');
header('Pragma: no-cache');
header("Content-Type: application/octet-stream");
header("Content-Disposition: attachment; filename=\"".$urlfilename."\"");
header("Content-Length: ".filesize($filepath));
fpassthru($fp);
exit;
?>

PHP version is: 4.1.2 and I'm using the latest versions of IE and avant
browser running under Windows 2000

Really appreciate any help from any php masters!

-Nick.


Reply With Quote
  #2 (permalink)  
Old 11-16-2003
Game Dev
 
Posts: n/a
Default Re: fpassthru sessions and avant browser issues

Incase anyone had the same problem: the Avant issue is fixed in the latest
update to their browser.



"GameDev" <spam@spambaron.com> wrote in message
news:Ft-cnW9MQZk1zS-iU-KYjw@giganews.com...
> I have a section of my website where customers can login and download a

few
> select files.
> The download links are to php scripts that decide which files to download.
>
> Generally it works fine. However I have one browser compaibilty problem

and
> an annoyance with MS Internet Explorer
>
> With IE if the user cancels the download (they are only small downloads so
> this is unlikely) the browser will stop working corectly from then on: All
> links on the page will stop working until the browser is closed and
> reopened.
>
> With the Avant Browser (http://www.avantbrowser.com ) Downloads fail as

the
> DL script seems to bump the user to the customer login page.
>
> Here's the code:
>
>
> <?php
> //Generic PHP Header Commands
> session_start();
>
> //Check the Customer is Logged In and kick them if they aren't (I think

this
> is where avant browser fails)
> if( !$_SESSION['CustomerID'] )
> {
> header("Location: http://{$_SERVER['HTTP_HOST']}" .
> dirname($_SERVER['PHP_SELF']) . '/cust-login.php');
> exit();
> }
>
> //then I get some data about the filename from our database and assign the
> correct filename to $filepath
> //I've deleted this section because it is irrelevant to this problem
>
> //here's where I output the file
> $fp = fopen($filepath, "rb");
> // send the right headers
> header('Cache-Control: no-cache, must-revalidate');
> header('Pragma: no-cache');
> header("Content-Type: application/octet-stream");
> header("Content-Disposition: attachment; filename=\"".$urlfilename."\"");
> header("Content-Length: ".filesize($filepath));
> fpassthru($fp);
> exit;
> ?>
>
> PHP version is: 4.1.2 and I'm using the latest versions of IE and avant
> browser running under Windows 2000
>
> Really appreciate any help from any php masters!
>
> -Nick.
>
>
>



Reply With Quote
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT +1. The time now is 07:12 AM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0