Jump to content

Archived

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

Jurik

Adding and Deleting, same path. only one working

Recommended Posts

Hi guys I have two peices of code one adds a file to a folder, the other deletes the file in the fodler. Both are using the same path, the add code works, however the delete code code not below is the coede I use on both pages.

[code]
$target_path = "\\\benin\\videolibrary\\";

$target_path = $target_path . basename( $_FILES['uploadedfile']['name']);
[/code]

[code]
{
  extract($row);
  chdir ("\\\benin\\videolibrary\\");
  unlink($Videofile);
}
[/code]

As you can see both are using the same path, the belete code however brings up the following error

[quote]
Warning: chdir(): No such file or directory (errno 2) in c:\documents and settings\administrator\my documents\web pages\st john fisher movie front end v2\delete.php on line 28

Warning: unlink(Seeifthisfileuploads.php): No such file or directory in c:\documents and settings\administrator\my documents\web pages\st john fisher movie front end v2\delete.php on line 29
[/quote]

Now im guessing the second error is because the first error occurs, does anyone know what is causing this problem and how to fix it, I can work out how its not working when the adding code works fine and there both using the same path

Share this post


Link to post
Share on other sites
[quote author=ProjectFear link=topic=112099.msg454882#msg454882 date=1161341587]
so the file and everything is uploaded?
[/quote]

Yep it appears in the database and everything, its just the second peice of code with the unlick command that dont seem to work

Share this post


Link to post
Share on other sites

×

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.