X-Original-To: pgsql-php@postgresql.org Received: from shield.pirmabanka.lv (unknown [195.114.57.4]) by postgresql.org (Postfix) with ESMTP id C2F9947633C for ; Thu, 20 Mar 2003 09:30:05 -0500 (EST) Received: from wall2.pirmabanka.lv (wall2-pub.pirmabanka.lv [195.114.57.14]) by shield.pirmabanka.lv (8.12.8/8.9.3) with SMTP id h2KEU5tw022188 for ; Thu, 20 Mar 2003 16:30:05 +0200 Received: from share.pirmabanka.lv ([10.0.0.10]) by wall2.pirmabanka.lv; Thu, 20 Mar 2003 16:30:04 +0200 (EET) Received: from pc311x1.pirmabanka.lv (localhost.localdomain [127.0.0.1]) by pirmabanka.lv (8.11.6/8.11.6) with SMTP id h2KEU4q25613 for ; Thu, 20 Mar 2003 16:30:04 +0200 Received: (qmail 16879 invoked by uid 100); 20 Mar 2003 14:30:58 -0000 Date: Thu, 20 Mar 2003 16:30:58 +0200 From: Victor Yegorov To: apz Cc: Postgres PHP Subject: Re: manage stored files via web Message-ID: <20030320143058.GE16456@pirmabanka.lv> Mail-Followup-To: apz , Postgres PHP References: <20030320104645.GA16456@pirmabanka.lv> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="k3qmt+ucFURmlhDS" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4i X-Archive-Number: 200303/27 X-Sequence-Number: 1939 --k3qmt+ucFURmlhDS Content-Type: text/plain; charset=koi8-r Content-Disposition: inline Content-Transfer-Encoding: quoted-printable * apz [20.03.2003 15:37]: > On Thu, 20 Mar 2003, Victor Yegorov wrote: > > What I want is that file name suggested by browser would be the one, st= ored > > in DB. I currently enclose it in Content-type: HTTP header, but that se= ems > > to be not working. >=20 > content-type, as name sais, is to suggest a 'type' of the file, should=20 > browser try to show the file (in case its plaintext/html) or should it=20 > call a plugin (ms word =3D "application/msword"). >=20 > What you want is you want to suggest that=20 > 1. browser saves the file > 2. browser use different name than the url one. >=20 > for this purpose you got in header option to do "Content-Disposition".=20 > Here I must warn you that IE expects Content-Disposition handled=20 > differently than other browsers. Here is what I used to do: >=20 > ---- > $myfakefilename =3D readFileName_FromDB(); > if (strstr($_SERVER["HTTP_USER_AGENT"], "MSIE")) // For IE > header("Content-Disposition: filename=3D$myfakefilename" . "%20");=20 > else // For Other browsers > header("Content-Disposition: attachment; filename=3D$myfakefilename");= =20 > ---- Great, exactly what I needed. One question - what for is "%20"? Explorer adds "[1]" suffix, when this space present. I've removed it. Thank you. --=20 Victor Yegorov --k3qmt+ucFURmlhDS Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.1 (GNU/Linux) iD8DBQE+edCi2RKGLEykUDYRAtSIAJ9M+630Bd11gv6PfXpk0IZJrSX9uwCg1wL8 VaBUrF62cFIZ4OtLsaEtN8c= =R+Ge -----END PGP SIGNATURE----- --k3qmt+ucFURmlhDS--