Jump to content

Unlink function not working with permission 600


Gruzin

Recommended Posts

Hi everyone,

 

I have a folder with permission 777 and I can upload files, but I can not delete this files using unlink function... Also I can not change file permission from 600 to 777 or 755.

 

Here is my error:

Warning: unlink(../../uploads/) [function.unlink]: Permission denied in /www/cid.ge/doc/admin/functions/eng/delete_image.php on line 11 

 

Thanks for any help,

George

I've tryed to change it using my ftp client (FlashFXP), doesn't work...

 

You'll need to cnange it via php. Your files will be owned by the same process as apache (usually apache), therefore logging in and trying to change permissions via an ftp client will not work.

Thanks guys,

 

here is my delete script, I'am trying to change chmod there... is that correct or do I have to change it when I upload the file?

 

<?php
require ('../../config.php');
$id = $_GET['del_id'];
$sql = mysql_query("SELECT * FROM aid_image WHERE id='$id'");
while($row = mysql_fetch_array($sql)){
$image = $row['image'];
}
$query = "DELETE FROM aid_image WHERE id='$id'";
$result = mysql_query($query) or die("Error: " . mysql_error());
$file = chmod("../../uploads/".$image, 0777); // remove file from directory
unlink($file);
header ('Location: eng_dir_image_management.php');
?>

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.