Skip site navigation (1) Skip section navigation (2)

Re: Saving result to file for download

From: Michael Glaesemann <grzm(at)myrealbox(dot)com>
To: pgsql-php(at)postgresql(dot)org
Subject: Re: Saving result to file for download
Date: 2003-10-28 00:01:55
Message-ID: F136D279-08D9-11D8-9192-0005029FC1A7@myrealbox.com (view raw or flat)
Thread:
Lists: pgsql-php
Hi M.P.

On Tuesday, Oct 28, 2003, at 04:56 Asia/Tokyo, Mariusz Pekala wrote:
>
> Why have you decided to store results in a file? Is that file to be 
> really
> big? or takes long to prepare?

Actually the file is pretty small (less than 8K) and is pretty quick to 
make (less than 2 seconds). I just didn't know how to do it any other 
way.

> Maybe generating the file 'on the fly' would be easier:
>
> 1) Provide a link to a script that generates the file
> (eg: <a href="file.php?type=whatever">get file here</a>
>
> 2) The script "file.php" sets the content type header to text/plain 
> and just
> outputs the result of a query. I am not sure how to set HTTP header on 
> Your
> webserver (with apache there is a PHP function header(string) )

This sounds like *exactly* what I am after. I'll give it a try!

Thanks for taking the time to respond. I knew there should be a better 
way but didn't know where to even start looking. I really appreciate 
your help.

Michael


In response to

Responses

pgsql-php by date

Next:From: S.P.VimalaDate: 2003-10-30 09:39:59
Subject: Upgrade problem with postgresql 7.3.4 and php 4.2
Previous:From: Mariusz PekalaDate: 2003-10-27 19:56:22
Subject: Re: Saving result to file for download

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group