"Michael Fesser" <netizen@gmx.dewrote in message
news:avlba41lpn7hl10471hlnuo2813fb8crvl@4ax.com...
Quote:
.oO(byteoart)
>
Quote:
>>I'm a newbie to php. I am trying to delete a file from the server that I
>>put
>>there (one file, not the whole directory). I am using unlink ($filename);
>>
>>I did the path as a relative path as follows:
>>../images/6/image_001.JPG
>>
>>I did a scandir
>>$files = scandir("../images/6");
>>
>>The print_r ($files); shows that the file is one of the files present.
>>
>>On the possibility that it's a protection problem (though it shouldn't be,
>>as I put it there in the first place), I did a
>>chmod($filename, "777");
>
777 is a really bad idea. It makes the file writable for all people with
access to the server.
>
Quote:
>>The file doesn't delete from the server. Any ideas?
>
Any error messages? Is error_reporting set to at least E_ALL and
display_errors enabled?
I put in error_reporting(E_ALL). I tried uploading another file (which I
intended to delete). I got the following error message:
Warning: move_uploaded_file() [function.move-uploaded-file]: open_basedir
restriction in effect. File(C:\WINDOWS\TEMP\php63.tmp) is not within the
allowed path(s):
However, using ftp, I can see that the file is there where it belongs and
the picture displays on the next page after the upload.
I then tried to delete the file and got this error message:
Warning: unlink(../images/6/image_007.JPG) [function.unlink]: Permission
denied
So, now I have three questions:
1 - Why did I get the error message on upload, yet it uploaded?
2 - Why didn't I get an error on chmod which appears immediately beofre the
unlink on which I got an error?
3 - Why did I get a permission denied problem for a file that I just put up
there/