[Klone-users] Re: File download
Stefano Barbato
barbato at koanlogic.com
Wed Mar 4 06:29:44 EST 2009
Hello,
On 03/mar/09, at 16:08, diakat 2000 wrote:
> I've got found a php solution:
>
> header('HTTP/1.1 102 Processing');
> // file creating
>
> header('HTTP/1.1 200 OK');
> // show file
>
> Is it possible to set the headers in this way? ( Maybe with
> response_set_field and response_print_header?)
> If so, can you give me a short example, please?
please try the following code:
----[ page.kl1 ]----
<%
/* long processing started... */
int i;
for(i = 0; i < 10; ++i)
sleep(1); // generate the file
io_codecs_remove(out);
io_printf(out, "HTTP/1.0 102 Processing\r\n\r\n");
io_flush(out);
/* still generating the output file..... */
for(i = 0; i < 10; ++i)
sleep(1);
/* done, print-out the file */
response_set_status(response, 200);
response_print_header(response);
io_printf(out, "this is the content of big file....");
%>
-----------------------
bye,
s
More information about the Klone-users
mailing list