How to check whether the filename is writable in PHP

2 Answers

0 votes
if (is_writable("d:\\data.txt")) 
    echo 'File is writable';
else 
    echo 'File is not writable';


/*
run: 

File is writable   

*/

 



answered Jul 2, 2016 by avibootz
0 votes
// File properties was set to Read-only

if (is_writable("d:\\image.jpg")) 
    echo 'File is writable';
else 
    echo 'File is not writable';


/*
run: 

File is not writable 

*/

 



answered Jul 2, 2016 by avibootz

Related questions

1 answer 184 views
1 answer 261 views
1 answer 237 views
2 answers 227 views
5 answers 423 views
1 answer 183 views
...