X-Original-To: pgsql-php@postgresql.org Received: from alegro.binertia.com (unknown [216.254.174.62]) by postgresql.org (Postfix) with ESMTP id B94FA4762D7 for ; Thu, 20 Mar 2003 08:34:28 -0500 (EST) Received: by alegro.binertia.com (Postfix, from userid 506) id 6BCA3C824A; Thu, 20 Mar 2003 08:41:43 -0500 (EST) Received: from localhost (localhost [127.0.0.1]) by alegro.binertia.com (Postfix) with ESMTP id 5FB4B19C206; Thu, 20 Mar 2003 08:41:43 -0500 (EST) Date: Thu, 20 Mar 2003 08:41:43 -0500 (EST) From: apz X-X-Sender: apz@binertia.com To: Victor Yegorov Cc: Postgres PHP Subject: Re: manage stored files via web In-Reply-To: <20030320104645.GA16456@pirmabanka.lv> Message-ID: References: <20030320104645.GA16456@pirmabanka.lv> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Archive-Number: 200303/26 X-Sequence-Number: 1938 On Thu, 20 Mar 2003, Victor Yegorov wrote: > What I want is that file name suggested by browser would be the one, stored > in DB. I currently enclose it in Content-type: HTTP header, but that seems > to be not working. content-type, as name sais, is to suggest a 'type' of the file, should browser try to show the file (in case its plaintext/html) or should it call a plugin (ms word = "application/msword"). What you want is you want to suggest that 1. browser saves the file 2. browser use different name than the url one. for this purpose you got in header option to do "Content-Disposition". Here I must warn you that IE expects Content-Disposition handled differently than other browsers. Here is what I used to do: ---- $myfakefilename = readFileName_FromDB(); if (strstr($_SERVER["HTTP_USER_AGENT"], "MSIE")) // For IE header("Content-Disposition: filename=$myfakefilename" . "%20"); else // For Other browsers header("Content-Disposition: attachment; filename=$myfakefilename"); ---- enjoy, /apz, Sometimes you get an almost irresistible urge to go on living.