Re: chmod->serve file->chmod back?

From: Date: Sat, 24 Jun 2000 21:17:15 +0000
Subject: Re: chmod->serve file->chmod back?
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-2932@lists.php.net to get a copy of this message
"Brady Brown" <brady@krispintech.com> wrote in message news:39551569.30963D2A@krispintech.com... > Something like this: > > <?PHP > > chmod("test.jpg",0644); > > print "<img src='test.jpg'>; > > flush(); > > chmod("test.jpg",0600); > > ?> > This only works sometimes. If I put a "sleep();" after > the print, it works more often the higher the argument is > for sleep. I assume this means that if the websever > doesn't touch the file before the permissions are changed > back, tough luck. When the output of the script is send to the client, the files is already chmod'ed to 600 again. This is because the script is ofcourse sequential parsed. So before the client gets a change to fetch the test.jpg it is already changed back to 600. Maybe there is another way, but this is just an explanation why your script doesn't work. Jeroen

« previous php.general (#2932) next »