chriscloyd Posted January 8, 2007 Share Posted January 8, 2007 im trying to change the file permissions using chmod so i can unlink a file but how do i go ahead and do thatthis is the error i have with my code[code]<?phpmysql_connect('localhost','www5965_chris','chriscloyd');mysql_select_db('www5965_chris');$id = $_GET['id'];$query = mysql_query("SELECT name, type, size, path FROM upload2 WHERE id = '$id'");while($test = mysql_fetch_array($query)) {$ftp_user_name = '[email protected]';$ftp_user_pass = '596511';$ftp_root = '/';$ftp_server = 'localhost';$conn_id = ftp_connect($ftp_server);$login_result = ftp_login($conn_id, $ftp_user_name, $ftp_user_pass);chmod("upload_test/".$test['name'],0777);unlink("upload_test/".$test['name']);}?>[/code]this is the error im gettingWarning: chmod() [function.chmod]: No such file or directory in /usr/home/www/public_html/delete.php on line 13Warning: unlink(upload_test/steam.exe) [function.unlink]: No such file or directory in /usr/home/www/public_html/delete.php on line 14 Link to comment https://forums.phpfreaks.com/topic/33321-chmod-using-php/ Share on other sites More sharing options...
trq Posted January 8, 2007 Share Posted January 8, 2007 Does the file exist in that location? PHP says it doesn't. Link to comment https://forums.phpfreaks.com/topic/33321-chmod-using-php/#findComment-155701 Share on other sites More sharing options...
chriscloyd Posted January 8, 2007 Author Share Posted January 8, 2007 ya it does Link to comment https://forums.phpfreaks.com/topic/33321-chmod-using-php/#findComment-155706 Share on other sites More sharing options...
matto Posted January 8, 2007 Share Posted January 8, 2007 You must have the path wrong or the file is unable to be read for some reason......what are the permissions on the file as it sits ? Link to comment https://forums.phpfreaks.com/topic/33321-chmod-using-php/#findComment-155708 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.