I've in Create.php the next code:

mkdir("uploads/".$folder);

So in Delete.php I have the next code:

rmdir("uploads/".$folder);

$folder has in Create.php also in Delete.php the same value.

But if I run Delete.php, I get the following error:

Warning: rmdir(uploads/text) [function.rmdir]: Permission denied in C:\Program Files\Abyss Web Server\htdocs\Delete.php on line 92.

What's wrong ?

    a: what platform are you doing this on?

    b: you cannot delete non-empty directories

    edit: i guess windows from the c:\prog..... error 😉 -my bad

      Platform: Windows XP

      I'll get an another error message if the folder not empty.

        You will get a permission denied if the directory contains any files.

        from PHP.net
        Attempts to remove the directory named by dirname. The directory must be empty, and the relevant permissions must permit this. Returns TRUE on success or FALSE on failure.

        Also, when using mkdir(), you must specify a permission level

        mkdir($path."/".$newdirectory, 0777);

          I've used also the permissionlevel 0777, but I'll get the same warning.

            I've found the problem.
            Before I delete the folder, the script looks for files in the folder.
            But I forgot the closedir() command, so I've no permission to delete it.

            Thank you for the reactions.

              Write a Reply...