Jump to content

Uploading/deleting files & dir with php on apache


Clarky

Recommended Posts

Running it on my localhost, so the owner wud be my account: brought it up in the terminal and got this:

 

drwxrwxrwx   2 Clarky  Clarky        68 Feb  2 00:16 Calvin Z
drwxrwxrwx   4 Clarky  Clarky       136 Feb  2 20:19 David Tan
drwxrwxrwx   4 Clarky  Clarky       136 Feb  2 20:18 Eric
drwxrwxrwx   5 Clarky  Clarky       170 Feb  2 20:18 Julian
drwxrwxrwx   4 Clarky  Clarky       136 Feb  2 20:18 MaoMao
drwxrwxrwx   4 Clarky  Clarky       136 Feb  1 22:16 SynRG
-rwxrwxrwx   1 Clarky  Clarky   7981801 Jan 18 09:58 test.mp3
-rwxrwxrwx   1 Clarky  Clarky  10386439 Jan 18 09:58 test2.mp3

Running it on my localhost, so the owner wud be my account

 

If the files where uploaded via php then they should be owned by whoever owns the Apache process. Usually this is apache. You cannot delete or modify these files because apache does not have permission to do so.

I'm having issues uploading and deleting files: i've written this function to delete files/directories:

 

function DeleteFileOrDir($file)
{
if(is_dir($file))
	{
	if(rmdir($file))
		{
		return true;
		}
	} else {
	if(unlink($file))
		{
		return true;
		}
	}
return false;
}

Nah, its the same issue - i just posted the code up in the php section as u said it wasnt a apache issue... I get these permission warnings and such... i mean creating directories with the php script works a treat - just not getting rid of them or uploading them.. kinda at a loss at wat to do on the matter

I;m guessing i can use the chown() function in php, but this isnt just a problem with the script i'm writting, but with all file manager scripts/my SMF forum, its just generally on my localhost - i cant do upload or delete files or directories

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.