Jump to content

Adding and Deleting, same path. only one working


Jurik

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
Link to comment
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
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.