473,326 Members | 2,102 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,326 software developers and data experts.

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.
Jul 17 '05 #1
1 2285
Incase anyone had the same problem: the Avant issue is fixed in the latest
update to their browser.

"GameDev" <sp**@spambaron.com> wrote in message
news:Ft********************@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.

Jul 17 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Steve | last post by:
hello all im looking to make a download script as i cannot use the .htaccess to control directory access to files as im using a php login system using mysql and sessions. i have been playing...
4
by: john | last post by:
How do u guys handle multiple sessions?? i.e, opening different browser windows by running iexplore.exe or clicking IE icons and opening the application. My sessions are mixing up. what i mean is...
2
by: stefan.machwirth | last post by:
Hi! I have a PHP page "transfer.php" and a MySQL db. The client should download binary files by "http://.... /transfer.php?ID=xx", where the ID is searched in the db and the real URI is read. ...
1
by: windandwaves | last post by:
Hi Gurus I am basically sorry that I have to bother you about this. I am a PHP beginner and I have been studying sessions and cookies over the last few weeks. I have learned lots, but I am...
3
by: Will Woodhull | last post by:
Hi, I'm new here-- I've been reading the group for a couple of days. Nice group; I like the way n00b33 questions are handled. I've been using a Javascript routine in index.html to determine a...
22
by: magic_hat60622 | last post by:
Hi all. I've got an app that dumps a user id into a session after successful login. the login page is http://www.mydomain.com/login.php. If the user visits pages on my site without the www (i.e.,...
3
Atli
by: Atli | last post by:
Introduction: Sessions are one of the simplest and more powerful tools in a web developers arsenal. This tool is invaluable in dynamic web page development and it is one of those things every...
8
by: Chuck Anderson | last post by:
I've instituted a sessions based scheme on my web site to combat hot linking to my images. When someone requests a page at my site, I set a session variable. I then use htaccess to redirect *all*...
2
by: mina2020 | last post by:
Avant Browser allows users to browse multiple Web sites simultaneously and to block all unwanted pop-up pages and Flash ads automatically. The integrated cleaner helps users clear all traces and...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.