Page 1 of 1

PHP chmod() and umask() not functioning

Posted: Tue Jan 31, 2012 3:42 am
by pbvamsi

Code: Select all

$url = 'http://gdata.youtube.com/feeds/api/playlists/blabla';
$fp = fopen($url, 'r'); 
$buffer='';
if ($fp) {
while (!feof($fp))
$buffer .= fgets($fp, 1024);
fclose($fp);
$buff=stripslashes($buffer);
$old = umask(0); 
file_put_contents("si.xml", $buff);
chmod("si.xml", 0777);
umask($old);
The warnings I get are

Code: Select all

Warning: file_put_contents(si.xml) [function.file-put-contents]: failed to open stream
Warning: chmod() [function.chmod]: Permission denied 
I've even manually set entire directory file permissions to 777, but no use.
Am using filezilla on windows