Page 1 of 1

Deleting Files from Folders on Server.

Posted: Mon Oct 23, 2006 8:34 am
by NotOnUrNelly
Hi All,

I have a small routine that allows me to upload images to certain folders on the webserver. This works fine so there is probably no need to show any code for this.

I also have an images database table that values are added to every time a picture is uploaded to the server. This tables holds things like, image title (text), jpgNo(int), calling pageId(int).

The two work toegether and when a page is diplayed the database is checked and the image is collected of from folder on the server and displayed on the page.

I want to create an admin page at the back end of my website. that lists images relevent to pages. I want to add a check box with a delete function next to each images to allow this image to be deleted.

I can manage to delete the value out of the database, so the image is no longer displayed on my page. What I have not done is tried to delete the image from the folder on the web server.

Can anyone tell me how this is done or pass me on any code to do this.

I have done a google search but cant really put my finger on it.

Many thanks
Jamie

Posted: Mon Oct 23, 2006 8:56 am
by JayBird

Posted: Mon Oct 23, 2006 9:02 am
by NotOnUrNelly
Many Thanks for that

J Bird,

I giv eit a go tonight after work.

No doubt I'll run into problems. So expect this post to be extended.

Thanks
Jamie

Posted: Mon Oct 23, 2006 9:03 am
by JayBird
No probs.

Unlink() is easy to use, you should have no problem