RE: [PHP] IE Download twice from DB - MAJOR disaster to db users

From: Date: Mon, 13 Aug 2001 09:12:21 +0000
Subject: RE: [PHP] IE Download twice from DB - MAJOR disaster to db users
Groups: php.general 
Request: Send a blank email to php-general+get-62393@lists.php.net to get a copy of this message
why don't you do some testing first. write these two lines: <? mail( 'your.own@email.com', 'visiting myself', "Sucked off $PHP_SELF on $HTTP_USER_AGENT ); sleep(2); // just for the sake of it ?> go to the page with several different browsers and catch your emails, see how many times it loads it. Cheers, Maxim Maletsky www.PHPBeginner.com -----Original Message----- From: Ben-Nes Michael [mailto:miki@canaan.co.il] Sent: Monday, August 13, 2001 5:56 PM To: Richard Lynch; php-general@lists.php.net Subject: [PHP] IE Download twice from DB - MAJOR disaster to db users Importance: High Hi - All db users read this !! I know it download it twice because in Netscape it take half of the time and also I see it start in the left bottom bar. I read that IE first read the headers fully ( including the file ) and then ask it again for opening. While Netscape read the file only once. Any ideas ? If I download from db twice while using IE means that all php servers that serve file from phtml cause the same problem, and that's a Major Problem :( Every one in the list that use db to store files should try to download the files with IE and Mozilla while measuring the time its take !!! Ill probably open a bug if no one will have idea how to disable double reading of the file or how to guess when IE read the headers and when its reading the file itself. > How do you know it downloads them twice? What are you seeing? > > Also, if you want it downloaded, Content-type should be > application/octet-stream. Perhaps that's causing the browser snag it and > try to display it on top of the download... Sounds like how MS would code > it. > > > Hi All > > > > I store files on MYSQL server but when I try to pull them out ( show them > on > > screen or download ) with IE it download them twice before showing them up > > :( > > > > I played with the headers (adding, removing) with no success. > > by the way in Netscape its work fine. > > > > here is the last code tried: > > > > <? > > $query = "select * from files where issue_id='$id'"; > > $result = mysql_query ($query) > > or die ("Invalid query"); > > > > $data = @MYSQL_RESULT($result,0, "file_data"); > > $type = @MYSQL_RESULT($result,0, "file_type"); > > $file_name = @MYSQL_RESULT($result,0, "file_name"); > > $file_size = @MYSQL_RESULT($result,0, "file_size"); > > > > // # To force save file > > file://header("Content-disposition: attachment; > filename=\"$file_name\""); > > > > Header("Content-type: $type"); > > header("Content-Length: $file_size"); > > header("Content-Disposition: inline; filename=$file_name"); > > > > echo $data; > > ?> > > > > -------------------------- > > Canaan Surfing Ltd. > > Internet Service Providers > > Ben-Nes Michael - Manager > > Tel: 972-4-6991122 > > http://sites.canaan.co.il > > -------------------------- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net For additional commands, e-mail: php-general-help@lists.php.net To contact the list administrators, e-mail: php-list-admin@lists.php.net

« previous php.general (#62393) next »