I tried changing the code to:

// send headers to browser to initiate file download
        header ("Content-Type: application/octet-stream");
        header ("Content-Disposition: attachment; filename=$realname");
        readfile($filename);
        if(connection_aborted()==0)
        {
                $query = "UPDATE $table_data SET status = '$SESSION_UID'
WHERE id = '$id'";
                $result=&$conn->Execute($query);
        }


But it still doesn't work as expected. What am I doing wrong?


thanks,

Luis    

-----Original Message-----
From: David Nicholson [mailto:[EMAIL PROTECTED]
Sent: Wednesday, July 30, 2003 8:18 AM
To: Luis Lebron
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP] Updating a table after a successful download


Hello,

This is a reply to an e-mail that you wrote on Wed, 30 Jul 2003 at
13:46, lines prefixed by '>' were originally written by you.
> The problem I am having is that when the download is canceled by
the
> user
> the document still shows up as being checked out. Is there a way
to
> know if
> the document has been successfully downloaded before I update the
> database.

The connection handling section of the manual may help you...
http://uk.php.net/manual/en/features.connection-handling.php

You could possibly use register_shutdown_function() and
connection_aborted() to set the status back if the connection was
cancelled.

David.

-- 
phpmachine :: The quick and easy to use service providing you with
professionally developed PHP scripts :: http://www.phpmachine.com/

          Professional Web Development by David Nicholson
                    http://www.djnicholson.com/

    QuizSender.com - How well do your friends actually know you?
                     http://www.quizsender.com/
                    (developed entirely in PHP)

Reply via email to