nobody? does any think this could be a bug or something?
i would like to know before submitting this as a bug. At 19:18 15-7-2002 +0200, gilles wrote: >hi, > >i've run in to a strange problem, > >i'm trying to output a pdf file from disk to the browser. > >this is fine under netscape but IE has problems. > >consider the following code: >------------------------------------------- ><? >error_reporting(E_ALL); > >session_start(); >if (!isset($_SESSION['download'])) { > @$_SESSION['download'] = $_GET['download']; >} > >if(isset($_GET["download"])){ > $file_name=$_SESSION['download']; > header("Content-type:application/pdf"); > header("Content-Disposition: inline;filename=\"mypdf.pdf\""); > header("Content-length:".(string)(filesize($file_name))); > header("location: $file_name"); >exit; >} >?> ><form method=get> ><INPUT TYPE="submit" name=download value="mypdf.pdf"> ></form> >------------------------------------------ > >the above code runs fine on NS and IE, >IE immediately loads and opens the pdf file inline. > >but this code which only has the difference of using the POST method >instead of the GET metod results in a "file is corrupt" message! > >------------------------------------------ ><? >error_reporting(E_ALL); > >session_start(); >if (!isset($_SESSION['download'])) { > @$_SESSION['download'] = $_POST['download']; >} > >if(isset($_POST["download"])){ > $file_name=$_SESSION['download']; > header("Content-type:application/pdf"); > header("Content-Disposition: inline;filename=\"mypdf.pdf\""); > header("Content-length:".(string)(filesize($file_name))); > header("location: $file_name"); >exit; >} >?> ><form method=post> ><INPUT TYPE="submit" name=download value="mypdf.pdf"> ></form> >------------------------------------------ > > >can anyone explain to me why you can't use the POST method? >is this a bug or is this as expected (i didn't). > >tnx, > >gilles > >i'm running php 4.2.1 on win2000 with IIS5 > > >-- >PHP General Mailing List (http://www.php.net/) >To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php