Jump to content

unlink() refusing to delete file


peter_anderson

Recommended Posts

I am trying to delete a file via unlink(). It's a .html file, stored in a folder on its own.

 

			// current directory
		$dir = dirname(__FILE__);
		$dir = str_replace('classes','',$dir);
		$file = str_replace('./',$dir,$fr['location']);
		unlink($fr['location']);
		if(!unlink($file)){
			echo 'err';
		}
		if(file_exists($file)){
			echo 'ok1';
		}

 

The $fr['location'] stores the real location, as ./uploads/1303577497/barebones.html.

 

I've tried every combination I can think of to delete it. I've even deleted it from FTP and re-uploaded it, in case it was a permissions issue, but it refuses to go. When I file_get_contents it, it appears as existing.

 

Can anyone help?

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.