note 62301 deleted from function.readfile by philip

From: Date: Mon, 05 Mar 2007 06:23:34 +0000
Subject: note 62301 deleted from function.readfile by philip
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-124081@lists.php.net to get a copy of this message
Note Submitter: Paladinux<francesco at paladinux dot net> ---- [1th Part of My MESSAGE] Argh!!!!!!!!!!!!! There is some difference from the browser In Explorer 6, 4 example, if you read file and force download, show the mask "Do you want't save or open the file?". If you save, it's all right, if not don't work. This is an example to "HOW RESOLVE EXPLOER SAVE PROBLEM IN FORCE-DOWNLOAD WRITTEN IN PHP MODE" Have fun! Paladinux ====================================== error_reporting(0); //Don't remove ##UNDERSTEND THE BROWSER function id_browser() { $browser=$GLOBALS['__SERVER']['HTTP_USER_AGENT']; if(ereg('Opera(/| )([0-9].[0-9]{1,2})', $browser)) { return 'OPERA'; } else if(ereg('MSIE ([0-9].[0-9]{1,2})', $browser)) { return 'IE'; } else if(ereg('OmniWeb/([0-9].[0-9]{1,2})', $browser)) { return 'OMNIWEB'; } else if(ereg('(Konqueror/)(.*)', $browser)) { return 'KONQUEROR'; } else if(ereg('Mozilla/([0-9].[0-9]{1,2})', $browser)) { return 'MOZILLA'; } else { return 'OTHER'; } } ## OBTAIN ID FROM GET $id=$_GET['id']; ##OBTAIN DATA FROM DB "SELECT * FROM your_attachment_table WHERE id=$id LIMIT 1"; # $id,$realname ,$srvname = $nome.'.'.$type,$byte,$download ##V.I.THINGS-> $type = strtolower($a_row['Attachment_Real_Ext']); $nome = str_pad($a_row['id'], 10, "0", STR_PAD_LEFT) ; #BUILDING PATH $abs_item="DATA/".$srvname; #BUILDING FILE DIMENSION $size=filesize($file); @set_time_limit(600); $browser=id_browser();

« previous php.notes (#124081) next »