TecTao Posted September 19, 2007 Share Posted September 19, 2007 Help please. I'm trying to remove images from a directory outside of the directory where the delete script resides using the unlink command. I've used it a million times but this time the application resides on a Windows OS. The directory structure is: Image is located _imgs/fab_imgs/$img Delete script: _admin-flg/delete_fab_imgs_submitted.php On a Unix server the script I would normally be using for unlinking would be the full pagh to the image: $myFile2 = "/home/worldbox/public_html/_imgs/fab_imgs/$img"; unlink($myFile2); Unfortunately, this application is on a Windows OS and trying to get the path and permissions is causing me to pull my hair out. Running echo $_SERVER['DOCUMENT_ROOT']; returns E:\http\florida-gl.com . So combing the usual page to the directories and files doesn't make sense. So I tried the following which would make sense: $myFile2 = "../_imgs/fab_imgs/$img"; unlink($myFile2); I get the following error: Warning: unlink(../_imgs/fab_imgs/CopyFabrication01_1.jpg) [function.unlink]: Permission denied in E:\http\florida-glass.com\_admin-flg\fab_delete_submitted.php on line 30 I can only set the permissions to rw,rw,rw So I'm i need of a little direction. Link to comment https://forums.phpfreaks.com/topic/69943-solved-unlink-problem-on-a-windows-server/ Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.