Hi i need ti delete a file from the server using php. I wrote the code and working fine in my localhost . But when i uploaded in to my ftp server then the following error came.

code:

if($phototo<>'defaultv.jpg'){
unlink('../share/'.$phototo);
}
header('Location: '.'manage_auto.php');

--------------------------------------------------------------------
Directory permission is 777
-------------------------------------------
Error:

Warning: unlink(../share/) [function.unlink]: Is a directory in /home/XXXXXX/XXXXXX/XXXX/delete_property.php on line 13

Warning: Cannot modify header information - headers already sent by (output started at /home/XXXXx/public_html/XXXXXX/delete_auto.php:13) in /home/XXXXx/public_html/XXXXXX/delete_auto.php on line 17

Any one help me please ..
Thanks
Rajeesh

Hi

Can you post more code.
Also just check that the file on your remote server IS actually 777. Sometimes mine sets locally but doesn't edit the remote server settings.

according to your error the $phototo variable is blank. see the '../share/', there is no file name. That is your problem. Check to make sure the variable has the correct value.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.