Jump to content


Photo

Adding and Deleting, same path. only one working


  • Please log in to reply
2 replies to this topic

#1 Jurik

Jurik
  • Members
  • PipPipPip
  • Advanced Member
  • 59 posts

Posted 20 October 2006 - 09:25 AM

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.

$target_path = "\\\benin\\videolibrary\\";

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

{
   extract($row);
   chdir ("\\\benin\\videolibrary\\");
   unlink($Videofile);
}

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

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


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

#2 JasonLewis

JasonLewis
  • Members
  • PipPipPip
  • Advanced Member
  • 3,351 posts
  • LocationVictoria, Australia

Posted 20 October 2006 - 10:53 AM

so the file and everything is uploaded?
Good luck with your coding.
Jason / ProjectFear / Jaysonic

#3 Jurik

Jurik
  • Members
  • PipPipPip
  • Advanced Member
  • 59 posts

Posted 20 October 2006 - 11:15 AM

so the file and everything is uploaded?


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




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users